dayjs#UnitType TypeScript Examples
The following examples show how to use
dayjs#UnitType.
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: util.ts From alauda-ui with MIT License | 6 votes |
export function minDate(a: Dayjs, b: Dayjs, unit: UnitType = 'date') {
return !a ? b : !b ? a : a.isBefore(b, unit) ? a : b;
}
Example #2
Source File: util.ts From alauda-ui with MIT License | 6 votes |
export function maxDate(a: Dayjs, b: Dayjs, unit: UnitType = 'date') {
return !a ? b : !b ? a : a.isAfter(b, unit) ? a : b;
}