Inline
This Property makes DatePicker Inline and always visible.
Data Type
(property) inline: boolean
Default
inline: false
Example
$("#datepickerExample").datepicker({ language: "nep", inline: true });
//OR
<input class="datepicker-here" type="text" data-language="nep" data-inline="true">
Language
This Property change DatePicker Language.
Data Type
(property) language: string
Default
language: "nep"
Example
$("#datepickerExample").datepicker({ language: "nep", inline: true });
//OR
<input class="datepicker-here" type="text" data-language="nep">
Note: Currently Nepali only available in default but you can customize it.
StartDate
This Property set the StartDate on which default view shown.
Data Type
(property) startDate: object
//datefomrat = {year:string,month:string,day:string}
Default
startDate: currentdate
Example
$("#datepickerExample").datepicker({ startDate: NepaliFunctions.GetCurrentBsDate() });
FirstDay
This Property set the FirstDay from which the day start.
Data Type
(property) firstDay: integer
Default
firstDay: 0
Example
$("#datepickerExample").datepicker({ startDay: 0 });
//0 = आइतवार, 1 = सोमवार, 2= मङ्गलवार, 3 = बुधवार, 4= बिहिवार, 5 = शुक्रवार, 6 = शनिवार
Weekends
This Property set the Weekend to marks as holiday.
Data Type
(property) weekends: array
Default
weekends: [6]
Example
$("#datepickerExample").datepicker({ weekends: [0,6] });
//0 = आइतवार, 1 = सोमवार, 2= मङ्गलवार, 3 = बुधवार, 4= बिहिवार, 5 = शुक्रवार, 6 = शनिवार
AltField
This Property set the altfield where duplicate of datevalue will be set.
Data Type
(property) altField: string or jqueryselector
Default
altField: ''
Example
$("#datepickerExample").datepicker({ altField: '#altfield'
// give # for element's id and . for element's class});
ToggleSelected
This Property define wheather to remove selection when clicking on selected cell.
Data Type
(property) toggleSelected: boolean
Default
toggleSelected: true
Example
$("#datepickerExample").datepicker({ toggleSelected:false});
KeyboardNav
This Property define wheather to activate Hotkeys or not.
Data Type
(property) keyboardNav: boolean
Default
keyboardNav: true
Example
$("#datepickerExample").datepicker({ keyboardNav:false});
Position
This Property define postion of datepicker.
Data Type
(property) position: string
Default
position: 'bottom left'
Example
$("#datepickerExample").datepicker({ position: 'top left'});
// available positions: top left,top right, bottom left, bottom right
Offset
This Property define distance between datepicker intializer element and datepicker.
Data Type
(property) offset: integer
Default
offset: 12
Example
$("#datepickerExample").datepicker({ offset: 32});
View
This Property define distance between datepicker intializer element and datepicker.
Data Type
(property) view: string
Default
view: "days"
Example
$("#datepickerExample").datepicker({ view: "months"});
//available views: years, months, days
MinView
This Property define minView for datepicker from which view date will be returned.
Data Type
(property) minView: string
Default
minView: "days"
Example
$("#datepickerExample").datepicker({ minView: "months"});
//available views: years, months, days
ShowOtherMonths
This Property define wheather to show months from other years or not.
Data Type
(property) showOtherMonths: boolean
Default
showOtherMonths: true
Example
$("#datepickerExample").datepicker({ showOtherMonths: false });
SelectOtherMonths
This Property define wheather to select months from other year or not.
Data Type
(property) selectOtherMonths: boolean
Default
selectOtherMonths: true
Example
$("#datepickerExample").datepicker({ selectOtherMonths: false });
MoveToOtherMonthsOnSelect
This Property define wheather to move other month view from other year or not on select.
Data Type
(property) moveToOtherMonthsOnSelect: boolean
Default
moveToOtherMonthsOnSelect: true
Example
$("#datepickerExample").datepicker({ moveToOtherMonthsOnSelect: false });
ShowOtherYears
This Property define wheather to show year from other decade.
Data Type
(property) showOtherYears: boolean
Default
showOtherYears: true
Example
$("#datepickerExample").datepicker({ showOtherYears: false });
SelectOtherYears
This Property define wheather to select year from other decade.
Data Type
(property) selectOtherYears: boolean
Default
selectOtherYears: true
Example
$("#datepickerExample").datepicker({ selectOtherYears: false });
MoveToOtherYearsOnSelect
This Property define wheather to move to year view from other decade on select.
Data Type
(property) moveToOtherYearsOnSelect: boolean
Default
moveToOtherYearsOnSelect: true
Example
$("#datepickerExample").datepicker({ moveToOtherYearsOnSelect: false });
MinDate
This Property define minimum date from where selection of date start.
Data Type
(property) minDate: object
Default
minDate: uptocalendar capacity
Example
$("#datepickerExample").datepicker({ minDate: {year: 2080, month: 1, day: 1} });
MaxDate
This Property define maximun date upto where selection of date start.
Data Type
(property) maxDate: object
Default
maxDate: uptocalendar capacity
Example
$("#datepickerExample").datepicker({ maxDate: {year: 2089, month: 1, day: 1} });
DisableNavWhenOutOfRange
This Property define wheather to disable nav(forward and backward button) option on Out range of given min or max date.
Data Type
(property) disableNavWhenOutOfRange: boolean
Default
disableNavWhenOutOfRange: true
Example
$("#datepickerExample").datepicker({ disableNavWhenOutOfRange: false });
MultipleDates
This Property define wheather to make multiple date selectable or not.
Data Type
(property) multipleDates: boolean
Default
multipleDates: false
Example
$("#datepickerExample").datepicker({ multipleDates: true });
MultipleDatesSeparator
This Property define the seprator between date when multiple date are selected.
Data Type
(property) multipleDatesSeparator: string
Default
multipleDatesSeparator: ','
Example
$("#datepickerExample").datepicker({ multipleDatesSeparator: ' ' });
//Note: neede symbol or white space.
Range
This Property define wheather to make range selectable or not. If you need beetwen dates or dateperoid you can enable this option.
Data Type
(property) range: boolean
Default
range: false
Example
$("#datepickerExample").datepicker({ range: true});
ShowEvent
This Property define on which event datepicker have to shown.
Data Type
(property) showEvent: string
Default
showEvent: 'focus'
Example
$("#datepickerExample").datepicker({ showEvent: 'click' });
//Note: you have to pass the valid javascript event
AutoClose
This Property define wheather to close datepicker on date selection or not.
Data Type
(property) autoClose: boolean
Default
autoClose: true
Example
$("#datepickerExample").datepicker({ autoClose: false });
MonthsField
This Property define which type of month shown on month view.
Data Type
(property) monthsField: string
Default
monthsField: "monthsShort"
Example
$("#datepickerExample").datepicker({ monthsField: "months" });
//available options: months,monthsShort
//months=["Baisakh","Jestha","Ashar","Shrawan","Bhadra","Ashoj","Kartik","Mangsir","Poush","Magh","Falgun","Chaitra"]
//monthsShort=["बैशाख","जेठ","अषाढ","श्रावण","भाद्र","आश्विन","कार्तिक","मङ्सिर","पौष","माघ","फाल्गुन","चैत्र"]
ConvertToDateObject
This function returns date in object format { year, month, day }.
new ConvertToDateObject(dateString: string, dateFormat: string): object
Parameters
dateString (string) any date string
Returns
object: returns date in object and its format.
Example
NepaliFunctions.ParseDate("2080-01-01")
// returns { parsedDate: { year: 2080, month: 1, day: 1}, parsedFormat: "YYYY-MM-DD" }
AD2BS
This function converts AD date object to BS date object.
new AD2BS(adDate: (object | string), sourceDateFormat: string, returnDateFormat: string): string
Parameters
adDate ((object | string)) any AD date object or AD date string
sourceDateFormat (string) any available date formats and required only if adDate is string
returnDateFormat (string) any available date formats
Returns
string: converts AD date object to BS date object.
Example
NepaliFunctions.AD2BS({year: 2023, month: 7, day: 5})
// returns {year: 2080, month: 3, day: 20}
NepaliFunctions.AD2BS("2023-07-05")
// returns 2080-03-20
NepaliFunctions.AD2BS("2023-07-05", "YYYY-MM-DD")
// returns 2080-03-20
NepaliFunctions.AD2BS("2023-07-05", "YYYY-MM-DD", "YYYY/MM/DD")
// returns 2080/03/20
BS2AD
This function converts BS date object to AD date object.
new BS2AD(bsDate: (object | string), sourceDateFormat: string, returnDateFormat: string): string
Parameters
bsDate ((object | string)) any BS date object or BS date string
sourceDateFormat (string) any available date formats and required only if bsDate is string
returnDateFormat (string) any available date formats
Returns
string: converts BS date object to AD date object.
Example
NepaliFunctions.BS2AD({year: 2080, month: 3, day: 20})
// returns {year: 2023, month: 7, day: 5}
NepaliFunctions.BS2AD("2080-05-05")
// returns 2023-07-05
NepaliFunctions.BS2AD("2080-05-05", "YYYY-MM-DD")
// returns 2023-07-05
NepaliFunctions.BS2AD("2080-05-05", "YYYY-MM-DD", "YYYY/MM/DD")
// returns 2023/07/05
ParseDate
This function returns parsed date in object format {year, month, day}.
new ParseDate(dateString: string): object
Parameters
dateString (string) any date string
Returns
object: returns date in object and its format.
Example
NepaliFunctions.ParseDate("2080-01-01")
// returns { parsedDate: { year: 2080, month: 1, day: 1}, parsedFormat: "YYYY-MM-DD" }
GetCurrentBsDate
This function returns the current BS date object.
new GetCurrentBsDate(dateFormat: string): (object | string)
Parameters
dateFormat (string) any available date formats
Returns
(object | string): the current BS date object or string if date format is provided.
Example
NepaliFunctions.GetCurrentBsDate()
// Returns {year: 2080, month: 3, day: 20}
// if today's date is 3rd Ashar 2080
NepaliFunctions.GetCurrentBsDate('YYYY-MM-DD')
// Returns {year: 2080, month: 3, day: 20}
// if today's date is 3rd Ashar 2080
GetCurrentAdDate
This function returns the current AD date object.
new GetCurrentAdDate(dateFormat: string): (object | string)
Parameters
dateFormat (string) any available date formats.
Returns
(object | string): the current AD date object or string if date format is provided.
Example
NepaliFunctions.GetCurrentAdDate()
// Returns {year: 2023, month: 7, day: 5}
// if today"s date is 5th July 2023
NepaliFunctions.GetCurrentAdDate('YYYY-MM-DD')
// Returns 2023-07-05
// if today's date is 5th July 2023
GetCurrentBsYear
This function returns the current BS year.
new GetCurrentBsYear(): number
Returns
number: the current BS year.
Example
NepaliFunctions.GetCurrentBsYear()
// Returns 2080
// if today's date is 3rd Ashar 2080
GetCurrentAdYear
This function returns the current AD year.
new GetCurrentAdYear(): number
Returns
number: the current AD year.
Example
NepaliFunctions.GetCurrentAdYear()
// Returns 2023
// if today's date is 5th July 2023
GetCurrentBsMonth
This function returns the current BS month.
This function returns the current BS month.
Returns
number: the current BS month.
Example
NepaliFunctions.GetCurrentBsMonth()
// Returns 3
// if today's date is 3rd Ashar 2080
GetCurrentAdMonth
This function returns the current AD month.
new GetCurrentAdMonth(): number
Returns
number: the current AD month.
Example
NepaliFunctions.GetCurrentAdMonth()
// Returns 7
// if today's date is 5th July 2023
GetCurrentBsDay
This function returns the current BS day.
new GetCurrentBsDay(): number
Returns
number: the current BS day.
Example
NepaliFunctions.GetCurrentBsDay()
// Returns 3
// if today's date is 3rd Ashar 2080
GetCurrentAdDay
This function returns the current AD day.
new ConvertToDateObject(dateString: string, dateFormat: string): object
Returns
number: the current AD day.
Example
NepaliFunctions.GetCurrentAdDay()
// Returns 5
// if today's date is 5th July 2023
GetBsMonths
This function returns the BS months in English.
new GetBsMonths(): array
Returns
array: the BS months.
Example
NepaliFunctions.GetBsMonths()
// Returns ["Baisakh", "Jestha", "Ashar", "Shrawan", "Bhadra", "Ashoj", "Kartik", "Mangsir", "Poush", "Magh", "Falgun", "Chaitra"]
GetAdMonths
This function returns the AD months.
new GetAdMonths(): array
Returns
array: the AD months.
Example
NepaliFunctions.GetAdMonths()
// Returns ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
GetBsMonth
This function returns the BS month in English.
new GetBsMonth(number: number): string
Parameters
number (number) any number
Returns
string: the BS month.
Example
NepaliFunctions.GetBsMonth(11)
// Returns Chaitra
NepaliFunctions.GetBsMonth(0)
// Returns Baisakh
NepaliFunctions.GetBsMonth(-1)
// Returns null
NepaliFunctions.GetBsMonth(12)
// Returns null
GetAdMonth
This function returns the AD month.
new GetAdMonth(number: number): string
Parameters
number (number) any number
Returns
string: the AD month.
Example
NepaliFunctions.GetAdMonth(2)
// Returns March
NepaliFunctions.GetAdMonth(11)
// Returns December
NepaliFunctions.GetAdMonth(-1)
// Returns null
NepaliFunctions.GetAdMonth(12)
// Returns null
GetBsMonthsInUnicode
This function returns the BS months.
new GetBsMonthsInUnicode(): array
Returns
array: the BS months.
Example
NepaliFunctions.GetBsMonthsInUnicode()
// Returns ["बैशाख", "जेठ", "अषाढ", "श्रावण", "भाद्र", "आश्विन", "कार्तिक", "मङ्सिर", "पौष", "माघ", "फाल्गुन", "चैत्र"]
GetBsMonthInUnicode
This function returns the BS month in unicode.
new GetBsMonthInUnicode(number: number): string
Parameters
number (number) any number
Returns
string: the BS month in unicode.
Example
NepaliFunctions.GetBsMonthInUnicode(0)
// Returns बैशाख
NepaliFunctions.GetBsMonthInUnicode(11)
// Returns चैत्र
NepaliFunctions.GetBsMonthInUnicode(12)
// Returns null
NepaliFunctions.GetBsMonthInUnicode(-1)
// Returns null
GetBsDaysUnicode
This function returns the BS days in unicode.
new GetBsDaysUnicode(): array
Returns
array: the BS days in unicode.
Example
NepaliFunctions.GetBsDaysUnicode()
// Returns ["आइतवार", "सोमवार", "मङ्गलवार", "बुधवार", "बिहिवार", "शुक्रवार", "शनिवार"]
GetAdDays
This function returns the AD days.
new GetAdDays(): array
Returns
array: the AD days.
Example
NepaliFunctions.GetAdDays()
// Returns ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
GetBsDayUnicode
This function returns the BS day in unicode.
new GetBsDayUnicode(number: number): string
Parameters
number (number) any number
Returns
string: the BS day in unicode.
Example
NepaliFunctions.GetBsDayUnicode(0)
// Returns आइतवार
NepaliFunctions.GetBsDayUnicode(7)
// Returns null
GetAdDay
This function returns the AD day.
new GetAdDay(number: number): string
Parameters
number (number) any number
Returns
string: the AD day.
Example
NepaliFunctions.GetAdDay(0)
// Returns Sunday
NepaliFunctions.GetAdDay(7)
// Returns null
GetBsDayInNumber
This function returns Bs Day in Number.
new GetBsDayInNumber(dateString: string, dateFormat: string): object
Parameters
dateString (string) any date string
Returns
number: returns day as number
Example
NepaliFunctions.GetBsDayInNumber({year: '2080',month: '3',day: '20',})
// returns 3
GetBsDaysUnicodeShort
This function returns the BS day in unicode.
new GetBsDayUnicodeShort(number: number): string
Parameters
number (number) any number
Returns
string: the BS day in unicode.
Example
NepaliFunctions.GetBsDayUnicodeShort(0)
// Returns आ
NepaliFunctions.GetBsDayUnicodeShort(7)
// Returns null
GetAdDaysShort
This function returns the AD days Short.
new GetAdDaysShort(): array
Returns
array: the AD days short.
Example
NepaliFunctions.GetAdDaysShort()
// returns ["S", "M", "T", "W", "T", "F", "S"]
GetBsDayUnicodeShort
This function returns the BS day in unicode.
new GetBsDayUnicodeShort(number: number): string
Parameters
number (number) any number
Returns
string: the BS day in unicode.
Example
NepaliFunctions.GetBsDayUnicodeShort(1)
// returns सो
NepaliFunctions.GetBsDayUnicodeShort(7)
// Returns null
GetAdDayShort
This function returns the AD day.
new GetAdDayShort(number: number): string
Parameters
number (number) any number
Returns
string: the AD day.
Example
NepaliFunctions.GetAdDayShort(1)
// returns M
NepaliFunctions.GetAdDayShort(7)
// returns null
GetBsFullDate
This function returns the full BS date.
new GetBsFullDate(bsDate: (object | string), unicodeFlag: boolean, dateFormat: string): string
Parameters
bsDate ((object | string)) any date object or date string
unicodeFlag (boolean) true or false
dateFormat (string) any available date formats and required only if bsDate is string
Returns
string: the full BS date.
Example
NepaliFunctions.GetBsFullDate({year: 2080, month: 3, day: 22}, false)
// returns 22 Ashar 2080
NepaliFunctions.GetBsFullDate("2080-03-22", false, "YYYY-MM-DD")
// returns 22 Ashar 2080
NepaliFunctions.GetBsFullDate("2079-03-15", true, "YYYY-MM-DD")
// returns १५ अषाढ २०७९
NepaliFunctions.GetBsFullDate({year: 2080, month: 12, day: 15}, true)
// returns १५ चैत्र २०८०
NepaliFunctions.GetBsFullDate({year: 2080, month: 5, day: 18}, true)
// returns १८ भाद्र २०८०
GetAdFullDate
This function returns the full AD date.
new GetAdFullDate(adDate: (object | string), dateFormat: string): string
Parameters
adDate (object | string) any date object or date string
dateFormat (string) any available date formats and required only if adDate is string
Returns
string: the full AD date.
Example
NepaliFunctions.GetAdFullDate({year: 2023, month: 3, day: 28})
// returns 28 March 2023
NepaliFunctions.GetAdFullDate("2023/09/04", "YYYY/MM/DD")
// returns 4 September 2023
GetBsFullDay
This function returns the day for the given BS date object or date string.
new GetBsFullDay(bsDate: (object | string), dateFormat: string): string
Parameters
bsDate (object | string) any date object or date string
dateFormat (string) any available date formats and required only if bsDate is string
Returns
string: the day.
Example
NepaliFunctions.GetBsFullDay({year: 2072, month: 3, day: 15})
// returns Tuesday
GetBsFullDayInUnicode
This function returns the day for the given BS date object or date string.
new GetBsFullDayInUnicode(bsDate: (object | string), dateFormat: string): string
Parameters
bsDate (object | string) any date object or date string
dateFormat (string) any available date formats and required only if bsDate is string
Returns
string: the day.
Example
NepaliFunctions.GetBsFullDayInUnicode({year: 2070, month: 12, day: 15})
// returns शनिवार
NepaliFunctions.GetBsFullDayInUnicode('2072-12-15', 'YYYY-MM-DD')
// Returns सोमवार
GetAdFullDay
This function returns the day for the given AD date object.
new GetAdFullDay(adDate: (object | string), dateFormat: string): string
Parameters
adDate (object | string) any date object or date string
dateFormat (string) any available date formats and required only if adDate is string
Returns
string: the day.
Example
NepaliFunctions.GetAdFullDay({year: 2021, month: 3, day: 15})
// returns Monday
NepaliFunctions.GetAdFullDay('2023-05-02', 'YYYY-MM-DD')
// returns Tuesday
GetDaysInBsMonth
This function returns the number of days in the given BS year and month.
new GetDaysInBsMonth(year: number, month: number): number
Parameters
year (number) any number
month (number) any number
Returns
number: that number of days in the given BS year and month.
Example
NepaliFunctions.GetDaysInBsMonth(2072, 12)
// returns 30
GetDaysInAdMonth
This function returns the number of days in the given AD year and month.
new GetDaysInAdMonth(year: number, month: number): number
Parameters
year (number) any number
month (number) any number
Returns
number: that number of days in the given AD year and month.
Example
NepaliFunctions.GetDaysInAdMonth(2022, 1)
// returns 31
BsDatesDiff
This function returns that number of days between the two BS dates.
new BsDatesDiff(startDate: (object | string), endDate: (object | string), dateFormat: string): number
Parameters
startDate ((object | string)) any BS date object or date string
endDate ((object | string)) any BS date object or date string
dateFormat (string) any available date formats and required only if startDate or endDate is string
Returns
number: that number of days between the two BS dates.
Example
NepaliFunctions.BsDatesDiff({year: 2021, month: 3, day: 15}, {year: 2020, month: 3, day: 17})
// returns 363
NepaliFunctions.BsDatesDiff('2023-05-06', '2023-08-06', 'YYYY-MM-DD')
//return 91
AdDatesDiff
This function returns that number of days between the two AD dates objects.
new AdDatesDiff(startDate: (object | string), endDate: (object | string), dateFormat: string): number
Parameters
startDate ((object | string)) any AD date object or date string
endDate ((object | string)) any AD date object or date string
dateFormat (string) any available date formats and required only if startDate or endDate is string
Returns
number: that number of days between the two AD dates.
Example
NepaliFunctions.AdDatesDiff({year: 2023, month: 5, day: 6}, {year: 2023, month: 8, day: 6})
// returns 92
NepaliFunctions.AdDatesDiff('2021-03-15', '2020-03-17')
// returns 363
NepaliFunctions.AdDatesDiff('2021-03-15', '2020-03-17', 'YYYY-MM-DD')
// returns 363
BsAddDays
This function returns the BS date object after adding the number of days.
new BsAddDays(bsDate: (object | string), noOfDays: number, dateFormat: string): object
Parameters
bsDate ((object | string)) any date object or date string
noOfDays (number) any number
dateFormat (string) any available date formats and required only if bsDate is string
Returns
object: the BS date object after adding the number of days.
Example
NepaliFunctions.BsAddDays({year: 2023, month: 5, day: 2}, 90)
// returns {year: 2023, month: 8, day: 1}
NepaliFunctions.BsAddDays('2023-05-02', 90, 'YYYY-MM-DD')
// returns 2023-08-01
BsAddMonth
This function returns the BS date object after adding the number of months.
new BsAddMonth(bsDate: (object | string), noOfMonths: number, dateFormat: string): object
Parameters
bsDate ((object | string)) any date object or date string
noOfMonths (number) any number
dateFormat (string) any available date formats and required only if bsDate is string
Returns
object: the BS date object after adding the number of months.
Example
NepaliFunctions.BsAddMonth({year: 2023, month: 5, day: 2}, 90)
// returns {year: '2030', month: '11', day: 2}
NepaliFunctions.BsAddMonth('2023-05-02', 90, 'YYYY-MM-DD')
// returns 2030-11-02
ValidateBsDate
This function checks the validity of the BS date.
new ValidateBsDate(bsDate: (object | string), dateFormat: string): boolean
Parameters
bsDate ((object | string)) any BS date object or BS date string
dateFormat (string) any available date formats and required only if bsDate is string
Returns
boolean: the validity of the BS date object.
Example
NepaliFunctions.ValidateBsDate({year: 2020, month: 2, day: 30})
// returns true
NepaliFunctions.ValidateBsDate({year: 2020, month: 13, day: 30})
// returns false
NepaliFunctions.ValidateBsDate("2078-05-05")
// returns true
NepaliFunctions.ValidateBsDate("2078/01/30")
// returns false
NepaliFunctions.ValidateBsDate("2078/01/30", "YYYY/MM/DD")
// returns true
CompareBsDates
This function returns true if date is greater.
new CompareBsDates(date1: (object | string), date2: (object | string), dateFormat: string): boolean
Parameters
date1 ((object | string)) first date object or date string
date2 ((object | string)) second date object or date string
dateFormat (string) any available date formats and required only if startDate or endDate is string
Returns
boolean: true if date1 is greater than date2.
Example
NepaliFunctions.CompareBsDates({year: 2078, month: 2, day: 1}, {year: 2078, month: 1, day: 1})
// returns true
NepaliFunctions.CompareBsDates('2076-02-01', '2076-01-01')
// returns true
NepaliFunctions.CompareBsDates('2076-02-01', '2076-03-01')
// returns false
BetweenBsDates
This function returns if checkDate is between startDate and endDate.
new BetweenBsDates(checkDate: object, startDate: object, endDate: object, dateFormat: string, inclusive: boolean): boolean
Parameters
checkDate (object) check date object or date string
startDate (object) start date object or date string
endDate (object) end date object or date string
dateFormat (string) any available date formats and required only if startDate or endDate is string
inclusive (boolean)
Returns
boolean: true if checkDate is between startDate and endDate
Example
NepaliFunctions.BetweenBsDates({year: 2076, month: 2, day: 5}, {year: 2076, month: 1, day: 1}, {year: 2076, month: 2, day: 10})
// returns true
NepaliFunctions.BetweenBsDates('2076-01-01', '2076-01-05', '2076-02-10')
// returns false
NepaliFunctions.BetweenBsDates('2076/02/05', '2076/01/01', '2076/02/10', 'YYYY/MM/DD')
// returns true
ConvertToUnicode
This function converts number to unicode.
new ConvertToUnicode(number: number): string
Parameters
number (number) any number
Returns
string: that number converted to unicode string.
Example
NepaliFunctions.ConvertToUnicode(123456789)
// returns १२३४५६७८९
NepaliFunctions.ConvertToUnicode(14365.50)
//returns १४३६५.५
ConvertToNumber
This function converts unicode to number.
new ConvertToNumber(unicode: string): number
Parameters
unicode (string) any unicode number
Returns
number: that number.
Example
NepaliFunctions.ConvertToNumber("१२३४५६७८९")
// returns 123456789
NepaliFunctions.ConvertToNumber("१४३६५.५")
// returns 14365.50
NumberToWords
This function returns number to words in string.
new NumberToWords(number: number, isCurrency: boolean): string
Parameters
number (number) any number
isCurrency (boolean) true if you want to display currency
Returns
string: that number, converted to words.
Example
NepaliFunctions.NumberToWords(123456890.95, true)
// returns Twelve Crore Thirty Four Lakh Fifty Six Thousand Ninety Rupees and Ninety Five Paisa
NepaliFunctions.NumberToWords(15, true)
// returns Fifteen Rupees
NepaliFunctions.NumberToWords(15, false)
// returns Fifteen
NumberToWordsUnicode
This function returns number to words in unicode string.
new NumberToWordsUnicode(number: number, isCurrency: boolean): string
Parameters
number (number) any number
isCurrency (boolean) true if you want to display currency
Returns
string: that number, converted to words in unicode.
Example
NepaliFunctions.NumberToWordsUnicode(12345.1, true)
// returns बाह्र हजार तीन सय पैंतालिस रुपैंया दस पैसा
NepaliFunctions.NumberToWordsUnicode(12345.1, false)
// returns बाह्र हजार तीन सय पैंतालिस