material/date_utils
library
Functions
-
addMonthsToMonthDate(NepaliDateTime monthDate, int monthsToAdd)
→ NepaliDateTime
-
Add a given number of months to a NepaliDateTime object.
monthDate is the NepaliDateTime object to which the months are to be added.
monthsToAdd is the number of months to add.
Returns a new NepaliDateTime object with the given number of months added to the input.
-
dateOnly(NepaliDateTime date)
→ NepaliDateTime
-
Returns the date of a NepaliDateTime object without the time component.
date is the NepaliDateTime object to format.
Returns a new NepaliDateTime object with the same date as the input but with the time component set to 00:00:00.
-
dateOnlyEng(DateTime date)
→ DateTime
-
Returns the date of a DateTime object without the time component.
date is the DateTime object to format.
Returns a new DateTime object with the same date as the input but with the time component set to 00:00:00.
-
datesOnly(NepaliDateTimeRange range)
→ NepaliDateTimeRange
-
Returns a NepaliDateTimeRange with the same dates as the input but with the time component set to 00:00:00.
range is the NepaliDateTimeRange object to format.
Returns a new NepaliDateTimeRange object with the same dates as the input but with the time component set to 00:00:00.
-
firstDayOffset(int year, int month)
→ int
-
Return the offset of the first day of the month.
year is the year of the month.
month is the month of the year.
Returns the offset of the first day of the month.
-
formatMonth(DateTime date)
→ String
-
Format a month from a given DateTime object to its full name.
date is the DateTime object to format.
Returns the full name of the month.
-
formatRangeEndDate(MaterialLocalizations localizations, NepaliDateTime? startDate, NepaliDateTime? endDate, NepaliDateTime currentDate)
→ String
-
Format the end date of a range.
localizations is the MaterialLocalizations object to use for the formatting.
startDate is the start date of the range.
endDate is the end date of the range.
currentDate is the current date.
Returns the formatted end date.
-
formatRangeStartDate(MaterialLocalizations localizations, NepaliDateTime? startDate, NepaliDateTime? endDate)
→ String
-
Format the start date of a range.
localizations is the MaterialLocalizations object to use for the formatting.
startDate is the start date of the range.
endDate is the end date of the range.
Returns the formatted start date.
-
getDaysInMonth(int year, int month)
→ int
-
Return the number of days in a month.
year is the year of the month.
month is the month of the year.
-
isSameDay(NepaliDateTime? dateA, NepaliDateTime? dateB)
→ bool
-
Compare two NepaliDateTime objects to see if they are on the same day.
dateA is the first NepaliDateTime object to compare.
dateB is the second NepaliDateTime object to compare.
Returns true if the two dates are on the same day, false otherwise.
-
isSameMonth(NepaliDateTime? dateA, NepaliDateTime? dateB)
→ bool
-
Compare two NepaliDateTime objects to see if they are in the same month.
dateA is the first NepaliDateTime object to compare.
dateB is the second NepaliDateTime object to compare.
Returns true if the two dates are in the same month, false otherwise.
-
monthDelta(NepaliDateTime startDate, NepaliDateTime endDate)
→ int
-
Compare two NepaliDateTime objects to see if they are in the same year.
startDate is the first NepaliDateTime object to compare.
endDate is the second NepaliDateTime object to compare.
Returns true if the two dates are in the same year, false otherwise.