A beautiful, modern Nepali (Bikram Sambat) date picker with multiple themes, bilingual support, and complete BS/AD conversion. Zero dependencies, lightweight, and ready for production.
Everything you need for Nepali date picking
Choose your preferred installation method
<!-- 1. Include CSS from CDN --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/ompandey07/nepali-datepicker@main/dist/nepali-datepicker.css"> <!-- 2. Add container --> <div id="myDatePicker"></div> <!-- 3. Include JS from CDN --> <script src="https://cdn.jsdelivr.net/gh/ompandey07/nepali-datepicker@main/dist/nepali-datepicker.js"></script> <!-- 4. Initialize --> <script> NepaliDatePicker.init('#myDatePicker', { mode: 'bilingual', theme: 'default', onChange: function(date) { console.log('Selected:', date); } }); </script>
<!-- 1. Download files from GitHub and include CSS --> <link rel="stylesheet" href="dist/nepali-datepicker.css"> <!-- 2. Add container --> <div id="datepicker"></div> <!-- 3. Include JS --> <script src="dist/nepali-datepicker.js"></script> <!-- 4. Initialize --> <script> NepaliDatePicker.init('#datepicker', { mode: 'bilingual', theme: 'ocean' }); </script>
# npm package coming soon! npm install nepali-datepicker # For now, please use CDN or download files from GitHub # https://github.com/ompandey07/nepali-datepicker
Explore all themes and modes
All available options
| Option | Type | Default | Description |
|---|---|---|---|
| mode | String | 'bilingual' | 'bilingual', 'nepali', or 'english' |
| theme | String | 'default' | 'default', 'ocean', 'forest', 'sunset', 'rose' |
| dark | Boolean | false | Enable dark mode |
| minYear | Number | 2070 | Minimum BS year |
| maxYear | Number | 2099 | Maximum BS year |
| closeOnSelect | Boolean | true | Close after selection |
| showToday | Boolean | true | Show Today button |
| showClear | Boolean | true | Show Clear button |
| showClose | Boolean | true | Show Close button |
| showDisplay | Boolean | true | Show selected date display below |
| placeholder | String | 'मिति छान्नुहोस्' | Input placeholder (Nepali) |
| placeholderEn | String | 'Select Date' | Input placeholder (English) |
| onChange | Function | null | Callback on date select |
| onOpen | Function | null | Callback on calendar open |
| onClose | Function | null | Callback on calendar close |
Programmatic control
// Initialize const picker = NepaliDatePicker.init('#picker', opts); // Get selected date picker.getDate(); // Returns: { bs: {...}, ad: {...}, formatted: '...' } // Set date programmatically picker.setDate(2081, 5, 15); // Open / Close / Toggle calendar picker.open(); picker.close(); picker.toggle(); // Clear selection picker.clear(); // Change theme dynamically picker.setTheme('ocean'); picker.setDark(true); // Destroy instance picker.destroy(); // ========== Utility Functions ========== // Convert BS to AD NepaliDatePicker.utils.bsToAd(2081, 5, 15); // Returns: { year: 2024, month: 8, day: 30, dow: 5 } // Convert AD to BS NepaliDatePicker.utils.adToBs(2024, 8, 30); // Returns: { year: 2081, month: 5, day: 15 } // Convert to Nepali numerals NepaliDatePicker.utils.toNepali(2081); // Returns: '२०८१' // Get today's BS date NepaliDatePicker.utils.getToday(); // Returns: { year: 2081, month: 5, day: 15 }
2070 to 2099. Dates outside this range may not convert correctly. The date picker uses Google Fonts (Noto Sans Devanagari) - ensure internet connectivity for proper font rendering.Works on all modern browsers