[utils] Add placeholder to datetime utils
This commit is contained in:
parent
c9df257bbf
commit
d516839ad4
|
@ -17,12 +17,12 @@ export function formatDateTime(
|
||||||
return dateTimeFormat.format(date);
|
return dateTimeFormat.format(date);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function asDate(date?: Date) {
|
export function asDate(date?: Date, placeholder = '') {
|
||||||
return date ? formatDateTime(date, true) : '';
|
return date ? formatDateTime(date, true) : placeholder;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function asHour(date?: Date) {
|
export function asHour(date?: Date, placeholder = '') {
|
||||||
return date ? formatDateTime(date, false, true) : '';
|
return date ? formatDateTime(date, false, true) : placeholder;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function formatStartEnd(start: Date, end?: Date) {
|
export function formatStartEnd(start: Date, end?: Date) {
|
||||||
|
|
Loading…
Reference in New Issue