more data managing and getting ready and all

This commit is contained in:
Arjun Patel
2022-02-03 23:33:26 -08:00
parent 35bfd5312a
commit 479250c900
4 changed files with 139 additions and 26 deletions
+14 -1
View File
@@ -1,4 +1,4 @@
import moment from "moment";
const moment = require("moment");
export function generateGreetings(): string {
const hour = moment().hour();
@@ -17,3 +17,16 @@ export function generateGreetings(): string {
export function getTime(date?: Date) {
return date != null ? date.getTime() : 0;
}
const today = new Date();
const yesterday = today;
yesterday.setDate(yesterday.getDate() - 1);
const Days7Ago = today;
Days7Ago.setDate(Days7Ago.getDate() - 7);
const earlierThisMonth = today;
earlierThisMonth.setDate(earlierThisMonth.getDate() - 30);
export { today, yesterday, Days7Ago, earlierThisMonth };