Merge pull request #774 from ente-io/handling-negative-dateTime-value

improve invalid date string handling
This commit is contained in:
Abhinav Kumar 2022-11-21 14:02:56 +05:30 committed by GitHub
commit d16078e3e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -55,7 +55,8 @@ export function getUnixTimeInMicroSeconds(dateTime: Date) {
return null;
}
const unixTime = dateTime.getTime() * 1000;
if (unixTime <= 0) {
//ignoring dateTimeString = "0000:00:00 00:00:00";
if (unixTime === Date.UTC(0, 0, 0, 0, 0, 0, 0)) {
return null;
} else {
return unixTime;