Initial commit

Load this up somewhere where I can setup CI/CD
This commit is contained in:
2024-01-24 13:05:19 -05:00
commit 7119957c9e
458 changed files with 10153 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
export const ordinalToDate = (ordinal: number | string): Date => {
const year = parseInt(`20${ordinal.toString().substring(0, 2)}`);
const day = parseInt(ordinal.toString().substring(2));
const date = new Date(year, 0);
date.setDate(day);
return date;
};
export const dateToOrdinal = (date: Date): number => {
const start = new Date(date.getUTCFullYear(), 0, 0);
const diff = date.getTime() - start.getTime();
const day = `00${(Math.floor(diff / (1000 * 60 * 60 * 24)) + 1)}`;
return parseInt(`${(`${date.getUTCFullYear()}`).substring(2)}${day.substring(day.length - 3)}`);
};