(value: Date)
| 207 | return `${this.#declaration(keys)}${value}`; |
| 208 | } |
| 209 | #printDate(value: Date): string { |
| 210 | function dtPad(v: string, lPad = 2): string { |
| 211 | return v.padStart(lPad, "0"); |
| 212 | } |
| 213 | const m = dtPad((value.getUTCMonth() + 1).toString()); |
| 214 | const d = dtPad(value.getUTCDate().toString()); |
| 215 | const h = dtPad(value.getUTCHours().toString()); |
| 216 | const min = dtPad(value.getUTCMinutes().toString()); |
| 217 | const s = dtPad(value.getUTCSeconds().toString()); |
| 218 | const ms = dtPad(value.getUTCMilliseconds().toString(), 3); |
| 219 | // formatted date |
| 220 | const fData = `${value.getUTCFullYear()}-${m}-${d}T${h}:${min}:${s}.${ms}`; |
| 221 | return fData; |
| 222 | } |
| 223 | #dateDeclaration(keys: string[], value: Date): string { |
| 224 | return `${this.#declaration(keys)}${this.#printDate(value)}`; |
| 225 | } |
no test coverage detected