Add configuration file support
This commit is contained in:
parent
d141fe1d36
commit
ab51b4c11d
7 changed files with 204 additions and 51 deletions
|
@ -5,7 +5,7 @@ import duration, { Duration } from 'dayjs/plugin/duration.js';
|
|||
dayjs.extend(customParseFormat);
|
||||
dayjs.extend(duration);
|
||||
|
||||
export const parseTimestamp = (time: string): Dayjs => dayjs(time, 'HH:mm', true);
|
||||
export const parseTimestamp = (time: string): Dayjs => (time === 'now' ? dayjs() : dayjs(time, 'HH:mm', true));
|
||||
|
||||
export const parseDuration = (time: string): Duration => {
|
||||
const [hours, minutes] = time.split(':').map(Number);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue