Documentation

nepalidatepicker-instance

Retrieve Instance

Instance

You can retrieve the instance of a NepaliDatePicker, allowing you to access and manipulate its properties. The property returns an object with information about the current state of the datepicker.

JavaScript
const nepaliDatePicker = new NepaliDatePicker('#date-picker');

// Access instance properties
const currentDay = nepaliDatePicker.currentDay;
const currentMonth = nepaliDatePicker.currentMonth;
const currentYear = nepaliDatePicker.currentYear;
const today = nepaliDatePicker.today;

// Output instance properties
console.log('Current Day:', currentDay);
console.log('Current Month:', currentMonth + 1); // Month starts from 0
console.log('Current Year:', currentYear);
console.log('Today:', today);

If you want any other properties to be added, please Open An Issue.