date-fns APIs
- format
- parseISO
- addDays
- formatDistance
- formatDistanceToNow
- isBefore
- differenceInDays
- isToday
- isSameDay
- startOfDay
- subDays
- isValid
- addSeconds
- addMonths
- startOfMonth
- compareAsc
- addHours
- addMinutes
- formatDistanceStrict
- parse
- isYesterday
- isAfter
- getYear
- intervalToDuration
- endOfMonth
- differenceInHours
- formatISO
- differenceInMinutes
- addYears
- setMinutes
- setHours
- endOfDay
- isDate
- sub
- set
- startOfWeek
- differenceInCalendarMonths
- getDay
- addWeeks
- differenceInMonths
- fromUnixTime
- subMinutes
- isWithinInterval
- differenceInSeconds
- subHours
- differenceInCalendarDays
- getMinutes
- differenceInYears
- getHours
- endOfWeek
- setSeconds
- startOfToday
- startOfHour
- max
- differenceInMilliseconds
- endOfYear
- startOfYear
- isTomorrow
- differenceInCalendarYears
- endOfHour
- startOfMinute
- setYear
- setMonth
- subYears
- min
- getSeconds
- compareDesc
- getMonth
- endOfToday
- lastDayOfMonth
- differenceInCalendarWeeks
- subMonths
- lightFormat
- isSameMonth
- eachDayOfInterval
- getDate
- isMatch
- add
- formatDistanceToNowStrict
- formatRelative
OtherRelated APIs
date-fns#min JavaScript Examples
The following examples show how to use
date-fns#min.
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: DateRangePicker.js From discovery-mobile-ui with MIT License | 6 votes |
DateRangePicker = ({ timelineProps, dateRangeFilter, updateDateRangeFilter }) => {
const { minimumDate, maximumDate } = timelineProps;
if (!minimumDate || !maximumDate) {
return null;
}
const { dateRangeStart = minimumDate, dateRangeEnd = maximumDate } = dateRangeFilter;
return (
<View style={styles.container}>
<DatePicker
activeDate={dateRangeStart}
minimumDate={minimumDate}
maximumDate={min([maximumDate, dateRangeEnd])}
onDateSelect={(d) => updateDateRangeFilter('dateRangeStart', startOfDay(d))}
/>
<View><Text style={styles.dash}>-</Text></View>
<DatePicker
activeDate={dateRangeEnd}
minimumDate={max([minimumDate, dateRangeStart])}
maximumDate={maximumDate}
onDateSelect={(d) => updateDateRangeFilter('dateRangeEnd', endOfDay(d))}
/>
</View>
);
}