openacr icon indicating copy to clipboard operation
openacr copied to clipboard

Store report date in JSON format instead of plain text

Open dmundra opened this issue 4 years ago • 2 comments

Use https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON to save the date to YAML and update the display the convert the date in locale based human readable format.

dmundra avatar Dec 16 '21 21:12 dmundra

HTML 5 date field https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date

dmundra avatar Dec 30 '21 18:12 dmundra

I am going to table this change as the more I look into it the more I find that messing with encoding the date from input into JSON format and then decoding it back is more work than is gained right now. Here are a couple of stackoverflow links:

  • https://stackoverflow.com/questions/23593052/format-javascript-date-as-yyyy-mm-dd
  • https://stackoverflow.com/questions/10286204/what-is-the-right-json-date-format

Simple approach to getting the date has this weird timezone hoops to jump over. I could not find a way for JSON to just store YYYY-MM-DD without the time and the date field does not work with time data in it so I have do a striping step (examples from the first stackoverflow) link that just seems inaccurate. Moving this to backlog to revisit in the future, especially if we get the changes added to the validator itself first.

dmundra avatar Jan 05 '22 22:01 dmundra