mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-15 15:52:21 +00:00
fix(fires): reject rolled-over acquisition dates and document UTC times
This commit is contained in:
1 parent
5ae18032fc
commit
3de745bd33
4 files changed
+40
-2
No files matched your search
@@ -14,9 +14,13 @@ function acquiredMsUtc(acqDate, acqTime) {
|
||||
const hours = Number(hhmm.slice(0, 2));
|
||||
const minutes = Number(hhmm.slice(2, 4));
|
||||
if (hours > 23 || minutes > 59) return NaN;
|
||||
return Date.parse(
|
||||
const timestamp = Date.parse(
|
||||
`${acqDate}T${hhmm.slice(0, 2)}:${hhmm.slice(2, 4)}:00.000Z`,
|
||||
);
|
||||
return Number.isFinite(timestamp) &&
|
||||
new Date(timestamp).toISOString().slice(0, 10) === acqDate
|
||||
? timestamp
|
||||
: NaN;
|
||||
}
|
||||
|
||||
export const getEarthquakes = defineTool({
|
||||
|
||||
Reference in new issue
Block a user