@geniucode/common-utils
Version:
Common utils
66 lines • 1.55 kB
JavaScript
import { getDayInWeek, getShortISODate, getWeekNumber } from '../utils';
export const statisticsSchema = {
dayDate: {
type: String,
index: true,
default: function () {
const shortISO = getShortISODate();
return shortISO;
},
},
dayInWeek: {
type: String,
index: true,
default: function () {
return getDayInWeek();
},
},
weekNumber: {
type: String,
index: true,
default: function () {
return getWeekNumber();
},
},
month: {
type: String,
index: true,
default: function () {
const shortISO = getShortISODate().split('-')[1];
return shortISO;
},
},
year: {
type: String,
index: true,
default: function () {
const shortISO = getShortISODate().split('-')[0];
return shortISO;
},
},
hour: {
type: Number,
index: true,
default: function () {
const now = new Date();
return now.getHours();
},
},
minute: {
type: Number,
index: true,
default: function () {
const now = new Date();
return now.getMinutes();
},
},
second: {
type: Number,
index: true,
default: function () {
const now = new Date();
return now.getSeconds();
},
},
};
//# sourceMappingURL=statistics.js.map