blob: 32760cb10e2896e5b3d7ddb561f088aea748b39f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
|
import { songs, startDate } from "../constants";
// const epochMs = new Date(2022, 3, 10).valueOf();
// const now = Date.now();
// const index = Math.floor((now - epochMs) / msInDay);
const msInDay = 86400000;
const todaysDate = new Date();
const index = Math.floor((todaysDate.getTime() - startDate.getTime() )/msInDay)
export const todaysSolution = songs[index % songs.length];
|