
* remove classes in shipping & products utils * remove classes * add tests plans * add const * tests for shipping methods * test for shipping * test for shipping * tests for shipping * install eslint-plugin-chai-friendly * update stories * add missing imports
12 lines
398 B
JavaScript
12 lines
398 B
JavaScript
export function formatDate(date) {
|
|
const day = getPeriodValue(date, { day: "2-digit" });
|
|
const month = getPeriodValue(date, { month: "2-digit" });
|
|
const year = getPeriodValue(date, { year: "numeric" });
|
|
|
|
return new Array(year, month, day).join("-");
|
|
}
|
|
|
|
function getPeriodValue(date, option) {
|
|
const formatter = new Intl.DateTimeFormat("en-us", option);
|
|
return formatter.format(date);
|
|
}
|