U4-8745 - Allow selection of a date prior to 1900

Created by Tim Payne 19 Jul 2016, 15:49:59 Updated by Sebastiaan Janssen 04 Sep 2017, 09:33:03

Tags: Up For Grabs PR

Relates to: U4-7301

You cannot choose a date prior to 1900 using the built in date picker control. So if you need to add historical dates to your site, you can't.

It looks like you might be able to override the bootstrap date time picker to allow older dates, but it'd be nice to be able to do that out of the box, is there any particular reason for the 1900 limit?

If not, am happy to submit a PR to fix this :)

Comments

Sebastiaan Janssen 19 Jul 2016, 18:18:31

Would be great if the start/end date was configurable!


Tim Payne 20 Jul 2016, 14:11:59

That's a good idea actually. Not sure how much work would be required for that, as the picker is used outside of the standard content as well. I'll have a look through the code at the weekend and see what's what. There may also be problems if there's multiple pickers on the same page.......


Tim Payne 20 Jul 2016, 14:17:37

OK, looking at the code, min/max date should be configurable on a per editor basis. I'll see if I can get this working.


Bjarne Fyrstenborg 20 Jul 2016, 23:48:33

It seems to be related to this issue http://issues.umbraco.org/issue/U4-7301 where I was working on extending the datepicker to allow only time, date or datetime, set start and end date .. etc.

However some issues I had was that where saving a raw datetime string in a config option (textstring) it re-formatted the datetime format. See more in this PR: https://github.com/umbraco/Umbraco-CMS/pull/984


Nik 03 Nov 2016, 18:01:08

New PR added, based on how the Bootstrap-DateTime JS works.

https://github.com/umbraco/Umbraco-CMS/pull/1606


John Churchley 17 Feb 2017, 13:47:10

Hi Nik, does this allow for dates before 01/01/1753? (SQL Server earliest date range)


Nik 17 Feb 2017, 15:51:07

@John.Churchley, Unfortunately not because the Umbraco Core supports SQL CE which doesn't support DateTime2 data types. The DateTime2 data type allows down to 0001-01-01 as valid date times so it is unlikely that level of support will be brought into the core until it stops supporting SQL CE.

If you were to use your own branch of the core that removed support for SQL CE, you could then proceed to update it further and change the SQL data type for dates to DateTime2


Priority: Normal

Type: Bug

State: Open

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.4.3

Due in version:

Sprint:

Story Points:

Cycle: