push rasad front on new repo
This commit is contained in:
14
src/utils/isDateOlderThanToday.js
Normal file
14
src/utils/isDateOlderThanToday.js
Normal file
@@ -0,0 +1,14 @@
|
||||
export function isDateOlderThanToday(date) {
|
||||
// Create a Date object for today's date
|
||||
var today = new Date();
|
||||
today.toLocaleString("fa-IR", { timeZone: "Asia/Tehran" });
|
||||
|
||||
// Create a Date object for the input date
|
||||
|
||||
// Compare the input date with today's date
|
||||
if (date < today) {
|
||||
return true; // The input date is older than today
|
||||
} else {
|
||||
return false; // The input date is today or a future date
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user