fix: cycle date validation (#922)

This commit is contained in:
Anmol Singh Bhatia 2023-04-22 18:17:17 +05:30 committed by GitHub
parent e53847c59e
commit d041d8be6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 37 additions and 18 deletions

View file

@ -177,6 +177,12 @@ export const renderShortTime = (date: string | Date) => {
export const isDateRangeValid = (startDate: string, endDate: string) =>
new Date(startDate) < new Date(endDate);
export const isDateGreaterThanToday = (dateStr: string) =>{
const date = new Date(dateStr);
const today = new Date();
return date > today;
}
export const renderLongDateFormat = (dateString: string) => {
const date = new Date(dateString);
const day = date.getDate();