27 lines
937 B
JavaScript
27 lines
937 B
JavaScript
import moment from "moment";
|
|
const range = {
|
|
Today: [moment(), moment()],
|
|
"Last 14 days": [moment().subtract(14, "days"), moment()],
|
|
"Last 7 days": [moment().subtract(7, "days"), moment()],
|
|
"Next 7 days": [moment(), moment().add(7, "days")],
|
|
"Next 14 days": [moment(), moment().add(14, "days")],
|
|
"Last Month": [
|
|
moment().startOf("month").subtract(1, "month"),
|
|
moment().startOf("month").subtract(1, "month").endOf("month"),
|
|
],
|
|
"This Month": [moment().startOf("month"), moment().endOf("month")],
|
|
"Next Month": [
|
|
moment().startOf("month").add(1, "month"),
|
|
moment().startOf("month").add(1, "month").endOf("month"),
|
|
],
|
|
"Last Quarter": [
|
|
moment().startOf("quarter").subtract(1, "quarters"),
|
|
moment().startOf("quarter").subtract(1, "day"),
|
|
],
|
|
"This Quarter": [
|
|
moment().startOf("quarter"),
|
|
moment().startOf("quarter").add(1, "quarter").subtract(1, "day"),
|
|
],
|
|
};
|
|
export default range;
|