date-fns APIs
- format
- parseISO
- addDays
- subDays
- isAfter
- isBefore
- parse
- add
- startOfDay
- differenceInDays
- addHours
- addMinutes
- isSameDay
- formatDistance
- formatDistanceToNow
- endOfDay
- startOfWeek
- isEqual
- subHours
- getYear
- isToday
- startOfMonth
- differenceInMilliseconds
- addMonths
- eachDayOfInterval
- differenceInSeconds
- getDaysInMonth
- isValid
- endOfMonth
- startOfHour
- differenceInCalendarDays
- getUnixTime
- endOfWeek
- addWeeks
- sub
- toDate
- subMinutes
- fromUnixTime
- getDate
- getDay
- formatISO
- isWithinInterval
- subMonths
- subWeeks
- formatRelative
- differenceInMinutes
- differenceInHours
- getMonth
- getHours
- formatDistanceToNowStrict
- intervalToDuration
- addMilliseconds
- addYears
- endOfYear
- startOfMinute
- subYears
- isSameMonth
- formatDuration
- lightFormat
- setDate
- eachMonthOfInterval
- startOfYear
- isPast
- addSeconds
- isWeekend
- parseJSON
- set
- roundToNearestMinutes
- setMinutes
- differenceInCalendarYears
- max
- isTomorrow
- startOfToday
- isSameYear
- addQuarters
- endOfHour
- endOfQuarter
- startOfQuarter
- subSeconds
- getTime
- compareAsc
- differenceInWeeks
- eachWeekOfInterval
- eachYearOfInterval
- endOfYesterday
- setDay
- getDaysInYear
- formatISODuration
- getMilliseconds
- differenceInCalendarMonths
- lastDayOfMonth
- endOfDecade
- endOfMinute
- startOfDecade
- isThisISOWeek
- startOfTomorrow
- Duration
- startOfYesterday
- isYesterday
- setHours
- getMinutes
- compareDesc
- differenceInCalendarQuarters
- eachHourOfInterval
- eachQuarterOfInterval
- getISODay
- getWeek
- isDate
- isFriday
- isLeapYear
- isMonday
- isSameWeek
- isSaturday
- isSunday
- isThursday
- isTuesday
- isWednesday
- min
- setMonth
- Locale
- millisecondsInHour
- hoursToSeconds
Other Related APIs
- date-fns#format
- date-fns#startOfDay
- date-fns#isAfter
- date-fns#isBefore
- date-fns#startOfWeek
- date-fns#addDays
- date-fns#isWithinInterval
- date-fns#endOfWeek
- date-fns#eachDayOfInterval
- date-fns#addWeeks
- date-fns#differenceInWeeks
- date-fns#isFriday
- date-fns#isSaturday
- date-fns#isSunday
- date-fns#isThursday
- date-fns#isTuesday
- date-fns#isWednesday
- assert#AssertionError
date-fns#isMonday TypeScript Examples
The following examples show how to use
date-fns#isMonday.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: dategrid.ts From calendar-hack with MIT License | 6 votes |
selectAll(dow: dayOfWeek) {
if (!this.first || !this.last) return []
const dates = eachDayOfInterval({ start: this.first, end: this.last });
switch (dow) {
case 'Monday':
return dates.filter(d => isMonday(d));
case 'Tuesday':
return dates.filter(d => isTuesday(d));
case 'Wednesday':
return dates.filter(d => isWednesday(d));
case 'Thursday':
return dates.filter(d => isThursday(d));
case 'Friday':
return dates.filter(d => isFriday(d));
case 'Saturday':
return dates.filter(d => isSaturday(d));
case 'Sunday':
return dates.filter(d => isSunday(d));
default:
throw new Error(`unhandled day of week ${dow}`);
}
}