UNPKG

owtlab-tracking

Version:
11 lines (10 loc) 282 B
export function getDatetimeIndex(input) { const date = input || new Date(); return { hour_of_day: date.getHours(), day_of_week: parseInt(1 + date.getDay()), day_of_month: date.getDate(), month: parseInt(1 + date.getMonth()), year: date.getFullYear(), }; }