update deps; make apis more type safe
This commit is contained in:
parent
9518ede41c
commit
292dcf5b49
46 changed files with 26911 additions and 550 deletions
|
|
@ -17,9 +17,7 @@ export class DateFormatter {
|
|||
getPreview(format?: string): string {
|
||||
const today = moment();
|
||||
|
||||
if (!format) {
|
||||
format = this.toFormat;
|
||||
}
|
||||
format ??= this.toFormat;
|
||||
|
||||
return today.locale(this.locale).format(format);
|
||||
}
|
||||
|
|
@ -35,7 +33,7 @@ export class DateFormatter {
|
|||
* from the locale of this machine.
|
||||
* @returns formatted date string or null if `dateString` is not a valid date
|
||||
*/
|
||||
format(dateString: string, dateFormat?: string, locale: string = 'en'): string | null {
|
||||
format(dateString: string | null | undefined, dateFormat?: string, locale: string = 'en'): string | null {
|
||||
if (!dateString) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue