zooniverse / operationwardiary

Diaries of the First World War
operationwardiary.org
1 stars 1 forks source link

Date tag: problem selecting months #58

Closed ral104 closed 8 years ago

ral104 commented 8 years ago

Users have reported an issue where they try to select a month of less than 31 days from a month of 31 days. Example: selecting February from the dropdown month list when the last tag placed was for 31st January. In this case, the month then 'slips' onto March. Seems to be because the tag is trying to find the 31st day of the new month, but can't, so moves onto the next month.

Easy for users to fix by simply changing the month again, but the problem is that they often don't notice the issue until they've finished the page.

This appears to affect all browsers.

ral104 commented 8 years ago

Talk discussion here: http://talk.operationwardiary.org/#/boards/BWD000000m/discussions/DWD0000004?page=20&comment_id=56aa930088efb04ed70022b5

ral104 commented 8 years ago

@eatyourgreens any thoughts on whether this issue is fixable?

eatyourgreens commented 8 years ago

It's built-in behaviour in their browser: if you set a date to an invalid value, eg. '31 Nov 1917' then the browser corrects to the next valid date, '1 Dec 1917'.

if values are greater than their logical range (e.g. 13 is provided as the month value or 70 for the minute value), the adjacent value will be adjusted. from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date

I've added some code to reset the date to the first of the month if the new month doesn't match the selected month.

ral104 commented 8 years ago

@eatyourgreens thanks :)