(dateString: string)
| 1223 | * Check if a date/datetime represents today (time-aware) |
| 1224 | */ |
| 1225 | export function isTodayTimeAware(dateString: string): boolean { |
| 1226 | if (!dateString) return false; |
| 1227 | |
| 1228 | try { |
| 1229 | const taskDate = hasTimeComponent(dateString) |
| 1230 | ? parseDateToLocalInternal(dateString) |
| 1231 | : parseDateAsLocal(dateString); |
| 1232 | const now = new Date(); |
| 1233 | |
| 1234 | return isSameDay(taskDate, now); |
| 1235 | } catch (error) { |
| 1236 | tasknotesLogger.error("Error checking if today:", { |
| 1237 | category: "validation", |
| 1238 | operation: "checking-if-today", |
| 1239 | details: { dateString }, |
| 1240 | error: error, |
| 1241 | }); |
| 1242 | return false; |
| 1243 | } |
| 1244 | } |
| 1245 | |
| 1246 | /** |
| 1247 | * Validate datetime input (supports both date-only and date+time) |
no test coverage detected