8 lines
329 B
JavaScript
8 lines
329 B
JavaScript
// TODO: Implement this in `utils.js` when jest.importActual is landed.
|
|||
|
|
export default function getFormattedDate() {
|
||
|
|
const date = new Date();
|
||
|
|
const year = date.getFullYear();
|
||
|
|
const month = String(date.getMonth() + 1).padStart(2, "0");
|
||
|
|
const day = String(date.getDate()).padStart(2, "0");
|
||
|
|
return { year, month, day };
|
||
|
|
}
|