(date = new Date())
| 252 | * Uses the current date, or a provided date in the format of YYYY-MM-DD, i.e. 1970-11-05. |
| 253 | */ |
| 254 | export function buildDateStamp(date = new Date()) { |
| 255 | const year = `${date.getFullYear()}`; |
| 256 | const month = `${date.getMonth() + 1}`.padStart(2, '0'); |
| 257 | const day = `${date.getDate()}`.padStart(2, '0'); |
| 258 | |
| 259 | return [year, month, day].join('-'); |
| 260 | } |