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: 2001, month: 6, day: 1})
// returns {year: 2058, month: 2, day: 19}
NepaliFunctions.AD2BS({year: 2008, month: 5, day: 28})
// returns {year: 2065, month: 2, day: 15}
NepaliFunctions.AD2BS("2008-05-28")
// returns 2065-02-15
NepaliFunctions.AD2BS("2008-05-28", "YYYY-MM-DD")
// returns 2065-02-15
NepaliFunctions.AD2BS("2008-05-28", "YYYY-MM-DD", "YYYY/MM/DD")
// returns 2065/02/15

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: 2058, month: 2, day: 19})
// returns {year: 2001, month: 6, day: 1}
NepaliFunctions.BS2AD({year: 2065, month: 2, day: 15})
// returns {year: 2008, month: 5, day: 28}
NepaliFunctions.BS2AD("2065-02-15")
// returns 2008-05-28
NepaliFunctions.BS2AD("2065-02-15", "YYYY-MM-DD")
// returns 2008-05-28
NepaliFunctions.BS2AD("2065-02-15", "YYYY-MM-DD", "YYYY/MM/DD")
// returns 2008/05/28

ConvertToDateFormat

This function returns date in target format.

new ConvertToDateFormat(dateObj: string, returnFormat: string): string
Parameters
dateObj (string) any date object
returnFormat (string) target format
Returns
string: returns date in target format.
Example
NepaliFunctions.ConvertToDateFormat({year: 2000, month: 1, day: 1}, "YYYY-MM-DD")
// Returns "2001-01-01"
NepaliFunctions.ConvertToDateFormat({year: 2000, month: 1, day: 1}, "YYYY/MM/DD")
// Returns "2001/01/01"
NepaliFunctions.ConvertToDateFormat({year: 2000, month: 1, day: 1}, "MM-DD-YYYY")
// Returns "01-01-2001"
NepaliFunctions.ConvertToDateFormat({year: 2000, month: 1, day: 1}, "MM/DD/YYYY")
// Returns "01/01/2001"

ConvertToDateObject

This function returns date in object format {year, month, day}.

new ConvertToDateObject(dateString: string, dateFormat: string): object
Parameters
dateString (string) any date string
dateFormat (string) source format
Returns
object: returns date in object format.
Example
NepaliFunctions.ConvertToDateObject("2000-01-01", "YYYY-MM-DD")
// returns { year: 2000, month: 1, day: 1}
NepaliFunctions.ConvertToDateObject("2000/01/01", "YYYY/MM/DD")
// returns { year: 2000, month: 1, day: 1}
NepaliFunctions.ConvertToDateObject("01-01-2000", "MM-DD-YYYY")
// returns { year: 2000, month: 1, day: 1}
NepaliFunctions.ConvertToDateObject("01/01/2000", "MM/DD/YYYY")
// returns { year: 2000, month: 1, day: 1}

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 123.5

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(123.50)
// Returns १२३.५

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(123456000.12, true)
// Returns Twelve Crore Thirty Four Lakh Fifty Six Thousand Rupees and Twelve Paisa
NepaliFunctions.NumberToWords(12, true)
NepaliFunctions.NumberToWords(123456000.12, false)
// Returns Twelve Crore Thirty Four Lakh Fifty Six Thousand
NepaliFunctions.NumberToWords(12, false)
// Returns Twelve

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(123456000.12, true)
// Returns बाह्र करोड चौतीस लाख छपन्न हजार रुपैंया, बाह्र पैसा
NepaliFunctions.NumberToWordsUnicode(12, true)
NepaliFunctions.NumberToWordsUnicode(123456000.12, false)
// Returns बाह्र करोड चौतीस लाख छपन्न हजार
NepaliFunctions.NumberToWordsUnicode(12, false)
// Returns बाह्र

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("2000-01-01")
// returns { parsedDate: { year: 2000, month: 1, day: 1}, parsedFormat: "YYYY-MM-DD" }

AD.DatesDiff

This function returns that number of days between the two AD dates objects.

AD.DatesDiff
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.AD.DatesDiff({year: 2001, month: 3, day: 15}, {year: 2001, month: 3, day: 17})
// Returns 2
NepaliFunctions.AD.DatesDiff({year: 2003, month: 5, day: 2}, {year: 2003, month: 8, day: 1})
// Returns 91
NepaliFunctions.AD.DatesDiff('2003-05-02', '2003-08-01')
// Returns 91
NepaliFunctions.AD.DatesDiff('2003-05-02', '2003-08-01', 'YYYY-MM-DD')
// Returns 91

AD.GetCurrentDate

This function returns the current AD date object.

AD.GetCurrentDate
Parameters
dateFormat (string) any available date formats.
Returns
(object | string): the current AD date object or string if date format is provided.
Example
NepaliFunctions.AD.GetCurrentDate()
// Returns {year: 2020, month: 1, day: 1}
// if today"s date is 1st January 2020
NepaliFunctions.AD.GetCurrentDate('YYYY-MM-DD')
// Returns 2020-01-01
// if today"s date is 1st January 2020

AD.GetCurrentDay

This function returns the current AD day.

AD.GetCurrentDay
Returns
number: the current AD day.
Example
NepaliFunctions.AD.GetCurrentDay()
// Returns 1
// if today"s date is 1st January 2020

AD.GetCurrentMonth

This function returns the current AD month.

AD.GetCurrentMonth
Returns
number: the current AD month.
Example
NepaliFunctions.AD.GetCurrentMonth()
// Returns 1
// if today"s date is 1st January 2020

AD.GetCurrentYear

This function returns the current AD year.

AD.GetCurrentYear
Returns
number: the current AD year.
Example
NepaliFunctions.AD.GetCurrentYear()
// Returns 2020
// if today"s date is 1st January 2020

AD.GetDay

This function returns the AD day.

AD.GetDay
Parameters
number (number) any number
Returns
string: the AD day.
Example
NepaliFunctions.AD.GetDay(0)
// Returns Sunday
NepaliFunctions.AD.GetDay(5)
// Returns Friday
NepaliFunctions.AD.GetDay(7)
// Returns null

AD.GetDays

This function returns the AD days.

AD.GetDays
Returns
array: the AD days.
Example
NepaliFunctions.AD.GetDays()
// Returns ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]

AD.GetDaysInMonth

This function returns the number of days in the given AD year and month.

AD.GetDaysInMonth
Parameters
year (number) any number
month (number) any number
Returns
number: that number of days in the given AD year and month.
Example
NepaliFunctions.AD.GetDaysInMonth(2015, 2)
// Returns 28
NepaliFunctions.AD.GetDaysInMonth(2020, 1)
// Returns 31

AD.GetDayShort

This function returns the AD day.

AD.GetDayShort
Parameters
number (number) any number
Returns
string: the AD day.
Example
NepaliFunctions.AD.GetDayShort(0)
// Returns S
NepaliFunctions.AD.GetDayShort(5)
// Returns F
NepaliFunctions.AD.GetDayShort(7)
// Returns null

AD.GetDaysShort

This function returns the AD days Short.

AD.GetDaysShort
Returns
array: the AD days short.
Example
NepaliFunctions.AD.GetDaysShort()
// Returns ["S", "M", "T", "W", "T", "F", "S"]

AD.GetFullDate

This function returns the full AD date.

AD.GetFullDate
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.AD.GetFullDate({year: 2001, month: 3, day: 15})
// Returns 15 March 2001
NepaliFunctions.AD.GetFullDate({year: 2003, month: 5, day: 2})
// Returns 2 May 2003
NepaliFunctions.AD.GetFullDate("2003/05/02", "YYYY/MM/DD")
// Returns 2 May 2003

AD.GetFullDay

This function returns the day for the given AD date object.

AD.GetFullDay
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.AD.GetFullDay({year: 2001, month: 3, day: 15})
// Returns Thursday
NepaliFunctions.AD.GetFullDay({year: 2003, month: 5, day: 2})
// Returns Friday
NepaliFunctions.AD.GetFullDay('2003-05-02', 'YYYY-MM-DD')
// Returns Friday

AD.GetMonth

This function returns the AD month.

AD.GetMonth
Parameters
number (number) any number
Returns
string: the AD month.
Example
NepaliFunctions.AD.GetMonth(0)
// Returns January
NepaliFunctions.AD.GetMonth(5)
// Returns June
NepaliFunctions.AD.GetMonth(11)
// Returns December
NepaliFunctions.AD.GetMonth(-1)
// Returns null
NepaliFunctions.AD.GetMonth(12)
// Returns null

AD.GetMonths

This function returns the AD months.

AD.GetMonths
Returns
array: the AD months.
Example
NepaliFunctions.AD.GetMonths()
// Returns ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]

BS.AddDays

This function returns the BS date object after adding the number of days.

BS.AddDays
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.BS.AddDays({year: 2001, month: 3, day: 15}, 2)
// Returns {year: 2001, month: 3, day: 17}
NepaliFunctions.BS.AddDays({year: 2003, month: 5, day: 2}, 90)
// Returns {year: 2003, month: 8, day: 1}
NepaliFunctions.BS.AddDays('2003-05-02', 90, 'YYYY-MM-DD')
// '2003-08-01'

BS.DatesDiff

This function returns that number of days between the two BS dates.

BS.DatesDiff
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.BS.DatesDiff({year: 2001, month: 3, day: 15}, {year: 2001, month: 3, day: 17})
// Returns 2
NepaliFunctions.BS.DatesDiff({year: 2003, month: 5, day: 2}, {year: 2003, month: 8, day: 1})
// Returns 90
NepaliFunctions.BS.DatesDiff('2003-05-02', '2003-08-01', 'YYYY-MM-DD')
// Returns 90

BS.GetCurrentDate

This function returns the current BS date object.

BS.GetCurrentDate
Parameters
dateFormat (string) any available date formats
Returns
(object | string): the current BS date object or string if date format is provided.
Example
NepaliFunctions.BS.GetCurrentDate()
// Returns {year: 2076, month: 9, day: 1}
// if today"s date is 1st Poush 2076
NepaliFunctions.BS.GetCurrentDate('YYYY-MM-DD')
// Returns {year: 2076, month: 9, day: 1}
// if today"s date is 1st Poush 2076

BS.GetCurrentDay

This function returns the current BS day.

BS.GetCurrentDay
Returns
number: the current BS day.
Example
NepaliFunctions.BS.GetCurrentDay()
// Returns 1
// if today"s date is 1st Poush 2076

BS.GetCurrentMonth

This function returns the current BS month.

BS.GetCurrentMonth
Returns
number: the current BS month.
Example
NepaliFunctions.BS.GetCurrentMonth()
// Returns 9
// if today"s date is 1st Poush 2076

BS.GetCurrentYear

This function returns the current BS year.

BS.GetCurrentYear
Returns
number: the current BS year.
Example
NepaliFunctions.BS.GetCurrentYear()
// Returns 2076
// if today"s date is 1st Poush 2076

BS.GetDayInUnicode

This function returns the BS day in unicode.

BS.GetDayInUnicode
Parameters
number (number) any number
Returns
string: the BS day in unicode.
Example
NepaliFunctions.BS.GetDayInUnicode(0)
// Returns आइतवार
NepaliFunctions.BS.GetDayInUnicode(4)
// Returns बिहिवार
NepaliFunctions.BS.GetDayInUnicode(7)
// Returns null

BS.GetDaysInUnicodeShort

This function returns the BS days in short.

BS.GetDaysInUnicodeShort
Returns
array: the BS days in short.
Example
NepaliFunctions.BS.GetDaysInUnicodeShort()
// Returns ["आ", "सो", "मं", "बु", "बि", "शु", "श"]

BS.GetDaysInMonth

This function returns the number of days in the given BS year and month.

BS.GetDaysInMonth
Parameters
year (number) any number
month (number) any number
Returns
number: that number of days in the given BS year and month.
Example
NepaliFunctions.BS.GetDaysInMonth(2015, 2)
// Returns 32
NepaliFunctions.BS.GetDaysInMonth(2020, 1)
// Returns 31

BS.GetDaysInUnicode

This function returns the BS days in unicode.

BS.GetDaysInUnicode
Returns
array: the BS days in unicode.
Example
NepaliFunctions.BS.GetDaysInUnicode()
// Returns ["आइतवार", "सोमवार", "मङ्गलवार", "बुधवार", "बिहिवार", "शुक्रवार", "शनिवार"]

BS.GetDayInUnicodeShort

This function returns the BS day in unicode.

BS.GetDayInUnicodeShort
Parameters
number (number) any number
Returns
string: the BS day in unicode.
Example
NepaliFunctions.BS.GetDayInUnicodeShort(0)
// Returns आ
NepaliFunctions.BS.GetDayInUnicodeShort(4)
// Returns बि
NepaliFunctions.BS.GetDayInUnicodeShort(7)
// Returns null

BS.GetFullDate

This function returns the full BS date.

BS.GetFullDate
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.BS.GetFullDate({year: 2075, month: 3, day: 15}, false)
// Returns 15 Ashar 2075
NepaliFunctions.BS.GetFullDate({year: 2075, month: 5, day: 2}, false)
// Returns 2 Bhadra 2075
NepaliFunctions.BS.GetFullDate("2075-03-15", false, "YYYY-MM-DD")
// Returns 2 Bhadra 2075
NepaliFunctions.BS.GetFullDate({year: 2075, month: 3, day: 15}, true)
// Returns १५ अषाढ २०७५
NepaliFunctions.BS.GetFullDate({year: 2075, month: 5, day: 2}, true)
// Returns २ भाद्र २०७५
NepaliFunctions.BS.GetFullDate("2075-03-15", true, "YYYY-MM-DD")
// Returns २ भाद्र २०७५

BS.GetFullDay

This function returns the day for the given BS date object or date string.

BS.GetFullDay
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.BS.GetFullDay({year: 2045, month: 3, day: 15})
// Returns Wednesday
NepaliFunctions.BS.GetFullDay({year: 2077, month: 5, day: 2})
// Returns Tuesday

BS.GetFullDayInUnicode

This function returns the day for the given BS date object or date string.

BS.GetFullDayInUnicode
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.BS.GetFullDayInUnicode({year: 2045, month: 3, day: 15})
// Returns बुधवार
NepaliFunctions.BS.GetFullDayInUnicode({year: 2077, month: 5, day: 2})
// Returns मङ्गलवार
NepaliFunctions.BS.GetFullDayInUnicode('2077-05-02', 'YYYY-MM-DD')
// Returns मङ्गलवार

BS.GetMonth

This function returns the BS month in English.

BS.GetMonth
Parameters
number (number) any number
Returns
string: the BS month.
Example
NepaliFunctions.BS.GetMonth(0)
// Returns Baisakh
NepaliFunctions.BS.GetMonth(5)
// Returns Ashoj
NepaliFunctions.BS.GetMonth(11)
// Returns Chaitra
NepaliFunctions.BS.GetMonth(-1)
// Returns null
NepaliFunctions.BS.GetMonth(12)
// Returns null

BS.GetMonthInUnicode

This function returns the BS month in unicode.

BS.GetMonthInUnicode
Parameters
number (number) any number
Returns
string: the BS month in unicode.
Example
NepaliFunctions.BS.GetMonthInUnicode(0)
// Returns बैशाख
NepaliFunctions.BS.GetMonthInUnicode(5)
// Returns आश्विन
NepaliFunctions.BS.GetMonthInUnicode(11)
// Returns चैत्र
NepaliFunctions.BS.GetMonthInUnicode(-1)
// Returns null
NepaliFunctions.BS.GetMonthInUnicode(12)
// Returns null

BS.GetMonths

This function returns the BS months in English.

BS.GetMonths
Returns
array: the BS months.
Example
NepaliFunctions.BS.GetMonths()
// Returns  ["Baisakh", "Jestha", "Ashar", "Shrawan", "Bhadra", "Ashoj", "Kartik", "Mangsir", "Poush", "Magh", "Falgun", "Chaitra"]

BS.GetMonthsInUnicode

This function returns the BS months.

BS.GetMonthsInUnicode
Returns
array: the BS months.
Example
NepaliFunctions.BS.GetMonthsInUnicode()
// Returns ["बैशाख", "जेठ", "अषाढ", "श्रावण", "भाद्र", "आश्विन", "कार्तिक", "मङ्सिर", "पौष", "माघ", "फाल्गुन", "चैत्र"]

BS.IsBetweenDates

This function returns if checkDate is between startDate and endDate

BS.IsBetweenDates
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.BS.IsBetweenDates({year: 2076, month: 2, day: 5}, {year: 2076, month: 1, day: 1}, {year: 2076, month: 2, day: 10})
// Returns true
NepaliFunctions.BS.IsBetweenDates({year: 2076, month: 1, day: 1}, {year: 2076, month: 1, day: 5}, {year: 2076, month: 2, day: 10})
// Returns false
NepaliFunctions.BS.IsBetweenDates('2076-02-05', '2076-01-01', '2076-02-10')
// Returns true
NepaliFunctions.BS.IsBetweenDates('2076-01-01', '2076-01-05', '2076-02-10')
// Returns false
NepaliFunctions.BS.IsBetweenDates('2076/02/05', '2076/01/01', '2076/02/10', 'YYYY/MM/DD')
// Returns true
NepaliFunctions.BS.IsBetweenDates('2076/01/01', '2076/01/05', '2076/02/10', 'YYYY/MM/DD')
// Returns false

BS.IsEqualTo

This function returns true if date1 is equal to date2.

BS.IsEqualTo
Parameters
date1 (object) date object or date string
date2 (object) 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 equal to date2.
Example
NepaliFunctions.BS.IsEqualTo({ year: 2076, month: 1, day: 1 }, { year: 2076, month: 1, day: 1 })
// Returns true
NepaliFunctions.BS.IsEqualTo({ year: 2076, month: 1, day: 1 }, { year: 2076, month: 2, day: 1 })
// Returns false
NepaliFunctions.BS.IsEqualTo("2076-01-01", "2076-01-01")
// Returns true
NepaliFunctions.BS.IsEqualTo("2076-01-01", "2076-01-02")
// Returns false
NepaliFunctions.BS.IsEqualTo("2076/02/01", "2076/02/01", "YYYY/MM/DD")
// Returns true
NepaliFunctions.BS.IsEqualTo("2076/03/01", "2076/02/01", "YYYY/MM/DD")
// Returns false

BS.IsGreaterThan

This function returns true if date1 is greater than date2.

BS.IsGreaterThan
Parameters
date1 (object) date object or date string
date2 (object) 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.BS.IsGreaterThan({ year: 2076, month: 2, day: 1 }, { year: 2076, month: 1, day: 1 })
// Returns true
NepaliFunctions.BS.IsGreaterThan({ year: 2076, month: 1, day: 1 }, { year: 2076, month: 2, day: 1 })
// Returns false
NepaliFunctions.BS.IsGreaterThan({ year: 2076, month: 2, day: 1 }, { year: 2076, month: 2, day: 1 })
// Returns false
NepaliFunctions.BS.IsGreaterThan("2076-02-01", "2076-01-01")
// Returns true
NepaliFunctions.BS.IsGreaterThan("2076-01-01", "2076-01-02")
// Returns false
NepaliFunctions.BS.IsGreaterThan("2076/03/01", "2076/02/01", "YYYY/MM/DD")
// Returns true
NepaliFunctions.BS.IsGreaterThan("2076/03/01", "2076/04/01", "YYYY/MM/DD")
// Returns false
NepaliFunctions.BS.IsGreaterThan("2076/03/01", "2076/03/01", "YYYY/MM/DD")
// Returns false

BS.IsGreaterThanOrEqualTo

This function returns true if date1 is greater than or equal to date2.

BS.IsGreaterThanOrEqualTo
Parameters
date1 (object) date object or date string
date2 (object) 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 or equal to date2.
Example
NepaliFunctions.BS.IsGreaterThanOrEqualTo({ year: 2076, month: 2, day: 1 }, { year: 2076, month: 1, day: 1 })
// Returns true
NepaliFunctions.BS.IsGreaterThanOrEqualTo({ year: 2076, month: 1, day: 1 }, { year: 2076, month: 2, day: 1 })
// Returns false
NepaliFunctions.BS.IsGreaterThanOrEqualTo({ year: 2076, month: 2, day: 1 }, { year: 2076, month: 2, day: 1 })
// Returns true
NepaliFunctions.BS.IsGreaterThanOrEqualTo("2076-02-01", "2076-01-01")
// Returns true
NepaliFunctions.BS.IsGreaterThanOrEqualTo("2076-01-01", "2076-01-02")
// Returns false
NepaliFunctions.BS.IsGreaterThanOrEqualTo("2076/03/01", "2076/02/01", "YYYY/MM/DD")
// Returns true
NepaliFunctions.BS.IsGreaterThanOrEqualTo("2076/03/01", "2076/04/01", "YYYY/MM/DD")
// Returns false
NepaliFunctions.BS.IsGreaterThanOrEqualTo("2076/03/01", "2076/03/01", "YYYY/MM/DD")
// Returns true

BS.IsLessThan

This function returns true if date1 is less than date2.

BS.IsLessThan
Parameters
date1 (object) date object or date string
date2 (object) 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 less than date2.
Example
NepaliFunctions.BS.IsLessThan({ year: 2076, month: 1, day: 1 }, { year: 2076, month: 2, day: 1 })
// Returns true
NepaliFunctions.BS.IsLessThan({ year: 2076, month: 3, day: 1 }, { year: 2076, month: 2, day: 1 })
// Returns false
NepaliFunctions.BS.IsLessThan({ year: 2076, month: 2, day: 1 }, { year: 2076, month: 2, day: 1 })
// Returns false
NepaliFunctions.BS.IsLessThan("2076-02-01", "2076-03-01")
// Returns true
NepaliFunctions.BS.IsLessThan("2076-01-03", "2076-01-02")
// Returns false
NepaliFunctions.BS.IsLessThan("2076/01/01", "2076/02/01", "YYYY/MM/DD")
// Returns true
NepaliFunctions.BS.IsLessThan("2076/03/01", "2076/02/01", "YYYY/MM/DD")
// Returns false
NepaliFunctions.BS.IsLessThan("2076/03/01", "2076/03/01", "YYYY/MM/DD")
// Returns false

BS.IsLessThanOrEqualTo

This function returns true if date1 is less than date2.

BS.IsLessThanOrEqualTo
Parameters
date1 (object) date object or date string
date2 (object) 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 less than date2.
Example
NepaliFunctions.BS.IsLessThanOrEqualTo({ year: 2076, month: 1, day: 1 }, { year: 2076, month: 2, day: 1 })
// Returns true
NepaliFunctions.BS.IsLessThanOrEqualTo({ year: 2076, month: 3, day: 1 }, { year: 2076, month: 2, day: 1 })
// Returns false
NepaliFunctions.BS.IsLessThanOrEqualTo({ year: 2076, month: 2, day: 1 }, { year: 2076, month: 2, day: 1 })
// Returns true
NepaliFunctions.BS.IsLessThanOrEqualTo("2076-02-01", "2076-03-01")
// Returns true
NepaliFunctions.BS.IsLessThanOrEqualTo("2076-01-03", "2076-01-02")
// Returns false
NepaliFunctions.BS.IsLessThanOrEqualTo("2076/01/01", "2076/02/01", "YYYY/MM/DD")
// Returns true
NepaliFunctions.BS.IsLessThanOrEqualTo("2076/03/01", "2076/02/01", "YYYY/MM/DD")
// Returns false
NepaliFunctions.BS.IsLessThanOrEqualTo("2076/03/01", "2076/03/01", "YYYY/MM/DD")
// Returns true

BS.ValidateDate

This function checks the validity of the BS date.

BS.ValidateDate
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.BS.ValidateDate({year: 2000, month: 2, day: 30})
// Returns true
NepaliFunctions.BS.ValidateDate({year: 2064, month: 4, day: 32})
// Returns true
NepaliFunctions.BS.ValidateDate({year: 2000, month: 13, day: 30})
// Returns false
NepaliFunctions.BS.ValidateDate({year: 2000, month: 12, day: 32})
// Returns false
NepaliFunctions.BS.ValidateDate("2078-01-05")
// Returns true
NepaliFunctions.BS.ValidateDate("2078-01-32")
// Returns false
NepaliFunctions.BS.ValidateDate("2078/01/30")
// Returns false
NepaliFunctions.BS.ValidateDate("2078/01/30", "YYYY/MM/DD")
// Returns true