Added date picker ranges to time ticket selector IO-532
This commit is contained in:
26
client/src/utils/DatePickerRanges.js
Normal file
26
client/src/utils/DatePickerRanges.js
Normal file
@@ -0,0 +1,26 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user