heimdall2 icon indicating copy to clipboard operation
heimdall2 copied to clipboard

Datetime format used in the nginx samples can't be parsed by native js Date object

Open Amndeep7 opened this issue 2 years ago • 2 comments
trafficstars

image

node and at least firefox from the browsers have a parsing incompatibility. it seems like 2017-09-22 14:12:44 -0400 is parsable by the Date constructor in node but not in firefox.

tested against chrome and it works fine there.

the issue with firefox has been historical (results of the caat export from previous releases) image

the error just bubbles all the way to the top now because of using the formatter class. the date class itself just silently accepts the erroneous output. https://github.com/mitre/heimdall2/blob/c3764a34364cf6c5114556168a652f793b357eae/libs/hdf-converters/src/converters-from-hdf/caat/reverse-caat-mapper.ts#L71-L79

Amndeep7 avatar Aug 20 '23 22:08 Amndeep7

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 5 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

sonarqubecloud[bot] avatar Aug 20 '23 22:08 sonarqubecloud[bot]

long term solution is to move to consistently using a datetime library whenever interacting with dates. we have a mix of plain js and momentjs. momentjs is no longer being actively maintained so we should find a replacement library. their official recommendation is luxon. luxon is able to (eventually) find the correct format type.

image

Amndeep7 avatar Aug 20 '23 23:08 Amndeep7