Skip to content

Releases: sanamhub/nepdate-cpp

Release list

v0.1.0-beta.1

v0.1.0-beta.1 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 22 Oct 02:04
bb1e7ad

First public pre-release. The API may still change before 0.1.0.

Two packages from one tag: header-only nepdate and the compiled nepdate-patro. The public
surface is in docs/API.md.

Added

  • BS and AD conversion. date is a 4-byte Bikram Sambat date; make_date, from_gregorian,
    from_sys_days and the to_* members convert both ways. Conversion is constexpr and
    allocates nothing. All 109,212 days from BS 1901 to 2199 round-trip BS to AD to BS in the
    tests, and the shared conversion vectors pass.
  • Arithmetic and fiscal year. add_days, add_months, add_years, diff, date_range and
    fiscal_year, with the shared clamp and spill rules.
  • Formatting and parsing. to_chars_* write into the caller's buffer and allocate nothing;
    parse and parse_lenient are constexpr over std::string_view and reject rather than
    guess.
  • The patro. nepdate::patro provides info, coverage, public_holidays, tithi and event
    for tithi, public holidays and events over BS 2077 to 2084.
  • vcpkg overlay ports and Conan recipes for both packages.
  • NEPDATE_VERSION_PRERELEASE in <nepdate/version.hpp>: the semver pre-release part (beta.1),
    empty for a stable version. project() holds numbers only, so NEPDATE_VERSION_STRING carries
    the full version.
  • C++20, built and tested on GCC 12, Clang 16 (with libstdc++ and with libc++), Apple Clang 16 and
    MSVC 19.44, each also with exceptions and RTTI disabled.

Notes

  • Benchmarks against C# NepDate are in docs/benchmarks.md. BS to AD is 7.09 ns on MSVC and
    5.58 ns on Clang against 13.29 ns for C# NepDate, with zero allocation. The patro month grid
    (B8) misses its target and is reported there.

Install

With CMake FetchContent, from the archive attached here:

include(FetchContent)
FetchContent_Declare(nepdate
    URL https://github.com/sanamhub/nepdate-cpp/releases/download/v0.1.0-beta.1/nepdate-cpp-0.1.0-beta.1.tar.gz
    URL_HASH SHA256=72d50e97f6e4cc253fdd287dd33e9759cfe361c1c70ff1e910845d4fbbf099c7)
FetchContent_MakeAvailable(nepdate)
target_link_libraries(your_app PRIVATE nepdate::nepdate nepdate::patro)

Or extract the archive, cmake --install it, and use find_package(nepdate) and
find_package(nepdate-patro). vcpkg and Conan Center listings follow upstream review.

Verification

gh release download v0.1.0-beta.1 --repo sanamhub/nepdate-cpp
sha256sum -c SHA256SUMS
gh attestation verify nepdate-cpp-0.1.0-beta.1.tar.gz --repo sanamhub/nepdate-cpp

After this release, verify-published downloaded these files, checked both, and built a
consumer from the archive on Linux, macOS and Windows.