Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Date Picker wrong year when year only entered #2051

Closed
coryasilva opened this issue Apr 11, 2014 · 4 comments
Closed

Date Picker wrong year when year only entered #2051

coryasilva opened this issue Apr 11, 2014 · 4 comments

Comments

@coryasilva
Copy link

http://angular-ui.github.io/bootstrap/#/datepicker

Entering a four digit year only (with the intent to have it resolve to a format 'dd/MM/yyyy') with result in the year before (probably off by a millisecond or something).

[small issue, but most likely not desired]

@bekos
Copy link
Contributor

bekos commented Apr 19, 2014

@coryasilva I am not sure what you mean, but probably this is related to #1289 which has already been fixed in master. Feel free to reopen if this is another issue.

@bekos bekos closed this as completed Apr 19, 2014
@coryasilva
Copy link
Author

Sorry my first post was horrible -- lack of sleep. I deeply apologize. lol

Please see this Plunkr

Problem:
When first typing in a year like "1940" and (in anticipation to use the date picker GUI to get to month and day), the date picker will actually set the date to "1939-12-31". Like I said note a big deal but I worry a careless user may not notice. Furthermore, if a user only types "1940" and then queries the database for all records 1940-1945 then we will have a problem. (Of course I will use some fuzzy logic but this is probably not desired behavior)

Background:
I came across this problem when working with historical archives. To make it easier for the archivist to input a date the format was set to an ISO date format "yyyy-MM-dd". (Year first because the actual day is seldom known).

@bekos
Copy link
Contributor

bekos commented Apr 19, 2014

Oh, now I understand. This is a timezone issue, and there is already one (more) open issues for this :-)

Can you though test if this is fixed with the latest master: http://plnkr.co/edit/PAvV5b5MqYIaoJV0yl7f?p=preview

@coryasilva
Copy link
Author

It is not fixed but I understand that it is a known issue. Thank you for looking at it!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants