From 89ddde28b8c716cb0f1dd242c9c920ea376bbdff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Wed, 18 Dec 2024 12:32:52 +0400 Subject: [PATCH] Add util for checking if ISO date string is today --- app/utils/iso-date-is-today.js | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 app/utils/iso-date-is-today.js diff --git a/app/utils/iso-date-is-today.js b/app/utils/iso-date-is-today.js new file mode 100644 index 0000000..5573644 --- /dev/null +++ b/app/utils/iso-date-is-today.js @@ -0,0 +1,4 @@ +export default function(value) { + const today = new Date().toISOString().split('T')[0]; + return value === today; +}