UNPKG

convertionanalytics-tracking

Version:

Track events - custom user actions, clicks, pageviews, purchases.

11 lines (10 loc) 314 B
export function getDatetimeIndex(input){ var 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() }; }