Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Date Fix #67

Merged
merged 3 commits into from
Feb 20, 2021
Merged

Conversation

PhilipMottershead
Copy link
Contributor

Made the date output more consistent and made the date field output in ISO-format

@argenos argenos linked an issue Feb 15, 2021 that may be closed by this pull request
@argenos argenos added this to the 0.1.1 milestone Feb 15, 2021
return (d.getMonth() < 10 ? "0" : "") + d.getMonth();
function getDate(date) {
const d = new Date(date);
return d.toISOString().substring(0,10);;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I seem to remember having tried this option and having had issues due to timezones.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the timezone used in toISOString is UTC, this can cause issues depending on the time of day and the timezone of the user. See this for more info.

@argenos argenos modified the milestones: 0.1.3, 0.1.4 Feb 17, 2021
@PhilipMottershead
Copy link
Contributor Author

I'll do a fix mostly working date offset in-case in fall in the wrong date

Either that it I can do a alternate change which starts the month from 1 so that it doesn't break

@PhilipMottershead
Copy link
Contributor Author

PhilipMottershead commented Feb 18, 2021

Added fix for timezones see response 2 https://stackoverflow.com/questions/23593052/format-javascript-date-as-yyyy-mm-dd

@argenos
Copy link
Owner

argenos commented Feb 18, 2021

Thanks! I think the fix should work, now it's just a matter of removing the lines where we use toISOString and instead always use the getDate method.

@PhilipMottershead
Copy link
Contributor Author

I changed it use the simpleISODate method that was apparently doing the same thing

@argenos argenos merged commit 319a96a into argenos:develop Feb 20, 2021
argenos added a commit that referenced this pull request Mar 27, 2021
Time zones were fixed in #67, but were incorrectly
using the `date` field instead of `dateAdded`.
The metadata export was incorrectly trying
to get timezone information from the Date field
which can contain partial information only.

Most likely fixes #80 and #13
@argenos argenos mentioned this pull request Mar 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect output of "Date Added"
2 participants