release v2.0.0 #4
|
@ -25,6 +25,17 @@ export function asHour(date?: Date) {
|
|||
return date ? formatDateTime(date, false, true) : '';
|
||||
}
|
||||
|
||||
export function formatStartEnd(start: Date, end?: Date) {
|
||||
const today = asDate(new Date());
|
||||
const startDate = asDate(start);
|
||||
const endDate = end ? asDate(end) : '';
|
||||
return (
|
||||
(today !== startDate ? `${startDate}, ` : '') +
|
||||
asHour(start) +
|
||||
(end ? ' - ' + (endDate !== startDate ? `${endDate}, ` : '') + asHour(end) : '')
|
||||
);
|
||||
}
|
||||
|
||||
export function startOfWeek(date: Date, startMonday = true) {
|
||||
const start = new Date(date);
|
||||
const day = date.getDay() || 7;
|
||||
|
|
Loading…
Reference in New Issue