(val: dayjs.ConfigType, unit: DateUnit)
| 58 | } |
| 59 | |
| 60 | export function formatDateWithUnit(val: dayjs.ConfigType, unit: DateUnit) { |
| 61 | if (unit === 'minute') { |
| 62 | return dayjs(val).format('HH:mm'); |
| 63 | } else if (unit === 'hour') { |
| 64 | return dayjs(val).format('HA'); |
| 65 | } else if (unit === 'day') { |
| 66 | return dayjs(val).format('MMM DD'); |
| 67 | } else if (unit === 'month') { |
| 68 | return dayjs(val).format('MMM'); |
| 69 | } else if (unit === 'year') { |
| 70 | return dayjs(val).format('YYYY'); |
| 71 | } |
| 72 | |
| 73 | return formatDate(val); |
| 74 | } |
| 75 | |
| 76 | function formatOffset(offset: number) { |
| 77 | const sign = offset >= 0 ? '+' : '-'; |
no test coverage detected