barshik-nepali-patro
Overview
A precise, zero-dependency Bikram Sambat calendar library for React and React Native — bundled BS month tables, public holidays, and a shared hook that drives both web and native UIs.
Role
Solo -- published to npm
Challenges
Almost every Bikram Sambat library on npm was either Angular-era, dependency-heavy, or quietly wrong around month boundaries. Naive BS-to-AD converters also drift by a day, because they are not normalised to the civil date.
Solutions
Month-length tables covering BS 2000 to 2100 ship bundled, so historical and projected years render without a network call. Conversion is epoch-based and normalised to the civil date, which removes the timezone and time-of-day drift. A requested year that is missing falls back to the latest known year rather than crashing. One useNepaliCalendar hook drives both the web and the React Native render target, behind separate nepali-patro, nepali-patro/native and nepali-patro/core entry points so bundles stay tree-shakeable. MIT licensed, zero dependencies.
Built with
4 in this project