
* reference type cypress working * refactor * remove screenshots * add reference * add slash marker * run tests based on shop version * fix run tests based on shop version * fix run tests based on shop version * change base url to localhost * fix plugins * fix plugins * fix plugins * fix plugins * fix plugins * fix plugins * fix yml * fix yml * chage file names * fix files names * fix broken imports add checking for errors in grpah responses * fix broken imports add checking for errors in grpah responses * update jest * fix snapshot
16 lines
303 B
JavaScript
16 lines
303 B
JavaScript
import moment from "moment-timezone";
|
|
|
|
export function getDatePeriod(days) {
|
|
if (days < 1) {
|
|
return {};
|
|
}
|
|
|
|
const end = moment().startOf("day");
|
|
const start = end.subtract(days - 1);
|
|
const format = "YYYY-MM-DD";
|
|
|
|
return {
|
|
gte: start.format(format),
|
|
lte: end.format(format)
|
|
};
|
|
}
|