(d?: Date | string, sep?: string)
| 131 | * `moment().format('YYYY-MM-DD')` format date string. |
| 132 | */ |
| 133 | export function YYYYMMDD(d?: Date | string, sep?: string): string { |
| 134 | if (typeof d === 'string') { |
| 135 | // YYYYMMDD(sep) |
| 136 | sep = d; |
| 137 | d = new Date(); |
| 138 | } else { |
| 139 | // YYYYMMDD(d, sep) |
| 140 | d = d || new Date(); |
| 141 | if (typeof sep !== 'string') { |
| 142 | sep = '-'; |
| 143 | } |
| 144 | } |
| 145 | const [ year, month, date ] = getDateStringParts(d, true); |
| 146 | return `${year}${sep}${month}${sep}${date}`; |
| 147 | } |
| 148 | |
| 149 | export interface DateStruct { |
| 150 | YYYYMMDD: number; |
no test coverage detected
searching dependent graphs…