Birthdates prior to 1900

Got something cool to share with AppGini users? Feel free to post it here!
Post Reply
David Soul
Veteran Member
Posts: 31
Joined: 2018-01-04 18:32
Location: Vancouver, Canada
Contact:

Birthdates prior to 1900

Post by David Soul » 2018-01-09 08:13

Is there any “easy” way to get around limitations of “date” type (to dates from 01-01-1900) while maintaining ability to sort on date and use various display dates formats?

Or is it easier just to throw in the towel and simply fallback to just using a numeric field for the year for my needs in the “people” table where I have individuals born from the 1500s?
David HC Soul

Core::AppGini 5.93
Plugins: Search Page Maker + Summary Reports + Mass update plugin
Bizzworxx: AppGini Helper JavaScript Library + AppGini Helper Detail View Plug-in + AppGini Helper pack
Utilities: Global Search utility

User avatar
Celson Aquino
Posts: 27
Joined: 2017-08-26 15:40
Location: Salvador, Bahia - Brazil

Re: Birthdates prior to 1900

Post by Celson Aquino » 2018-01-10 10:52

I think the limits for year have to do with the DATE type on MySQL database. The year range is 1901 to 2155 if I am not mistaken.

User avatar
baudwalker
Veteran Member
Posts: 188
Joined: 2015-02-03 08:08
Location: Bellingen NSW Australia

Re: Birthdates prior to 1900

Post by baudwalker » 2018-01-10 11:19

As long as you use the full 4 digit date I believe there is no real restriction.
To prove this, I made a small database and use the date of ( 1018-01-10 ) exactly 1000 years ago.

Two digit year dates do have restrictions as it does not realise what century you require

User avatar
Celson Aquino
Posts: 27
Joined: 2017-08-26 15:40
Location: Salvador, Bahia - Brazil

Re: Birthdates prior to 1900

Post by Celson Aquino » 2018-01-10 12:08

baudwalker wrote:
2018-01-10 11:19
As long as you use the full 4 digit date I believe there is no real restriction.
To prove this, I made a small database and use the date of ( 1018-01-10 ) exactly 1000 years ago.
What data type in AppGini did you use for this field?

grimblefritz
AppGini Super Hero
AppGini Super Hero
Posts: 336
Joined: 2015-12-23 16:52

Re: Birthdates prior to 1900

Post by grimblefritz » 2018-01-10 13:40

As we learned from the Y2K crisis/scare, the use of two-digit years is a VERY bad practice.

The solution to the problem is to always require and use four-digit years.

(Of course, this will only be a valid solution until the Y10K crisis comes along, but by then who will be around to care!)

David Soul
Veteran Member
Posts: 31
Joined: 2018-01-04 18:32
Location: Vancouver, Canada
Contact:

Re: Birthdates prior to 1900

Post by David Soul » 2018-01-10 19:05

Celson Aquino wrote:
2018-01-10 12:08
baudwalker wrote:
2018-01-10 11:19
As long as you use the full 4 digit date I believe there is no real restriction.
To prove this, I made a small database and use the date of ( 1018-01-10 ) exactly 1000 years ago.
What data type in AppGini did you use for this field?
That is the crux of the problem; I see no option within MySql therefore no work around in AppGini?
David HC Soul

Core::AppGini 5.93
Plugins: Search Page Maker + Summary Reports + Mass update plugin
Bizzworxx: AppGini Helper JavaScript Library + AppGini Helper Detail View Plug-in + AppGini Helper pack
Utilities: Global Search utility

User avatar
baudwalker
Veteran Member
Posts: 188
Joined: 2015-02-03 08:08
Location: Bellingen NSW Australia

Re: Birthdates prior to 1900

Post by baudwalker » 2018-01-11 01:01

yes I see what you mean. The ridicules date picker is the problem. it has a built-in restriction. MySQL will accept all 4 digit year dates.

As for after 9999-12-31 I would think there would be a better data structure by then.

The so-called 2YK bug was nothing more than a scam. I had an old XT running XP and it clocked over perfectly. but suddenly computer from around the mid 1990s had the problem inbuilt. funny that!

David Soul
Veteran Member
Posts: 31
Joined: 2018-01-04 18:32
Location: Vancouver, Canada
Contact:

Re: Birthdates prior to 1900

Post by David Soul » 2018-01-11 03:33

baudwalker wrote:
2018-01-11 01:01
yes I see what you mean. The ridicules date picker is the problem. it has a built-in restriction. MySQL will accept all 4 digit year dates.

As for after 9999-12-31 I would think there would be a better data structure by then.

The so-called 2YK bug was nothing more than a scam. I had an old XT running XP and it clocked over perfectly. but suddenly computer from around the mid 1990s had the problem inbuilt. funny that!
No, it is not a DatePicker Problem.
The solution:
The DateTime field time allows dates prior to 1900;
The incredibly useful AppGini “Search Page Maker” plugin handles my use case/need as it masks complexity of proper date formatting to “lay person” user in search in the data base.

(DatePicker doesn’t work for initial input choice but does for Filter selection)

ps. baudwalker you are wrong on Y2K ;) but that is a “political” discussion for a different forum/debate :geek:
Thanks for your notes though, as they led me to a more thorough review of MySql threads on coders websites that spoke “plain English” rather than technical manual speak I got from MySQl itself! 8-)
David HC Soul

Core::AppGini 5.93
Plugins: Search Page Maker + Summary Reports + Mass update plugin
Bizzworxx: AppGini Helper JavaScript Library + AppGini Helper Detail View Plug-in + AppGini Helper pack
Utilities: Global Search utility

peebee
AppGini Super Hero
AppGini Super Hero
Posts: 352
Joined: 2013-03-21 04:37

Re: Birthdates prior to 1900

Post by peebee » 2018-01-31 05:42

baudwalker - if you would like to edit the restrictions on the datepicker dropdown, just open the generated yourtablename_dml.php and search/find the section(s) that apply to your date comboboxes for each individual table.

Search for and edit these two default lines in each date combobox instance you'd like to change to whatever year ranges you'd like to be able to select from:

$combo_referred->MinYear = 1900;
$combo_referred->MaxYear = 2100;

eg - this will allow selection in the dropdown from years 1200 to 2990:

$combo_referred->MinYear = 1200;
$combo_referred->MaxYear = 2990;

You can of course then type the desired year into the year textbox and it will be selected in the dropdown rather than having to scroll through 1,000 or more years.

hubert
Veteran Member
Posts: 50
Joined: 2018-12-06 22:32

Re: Birthdates prior to 1900

Post by hubert » 2018-12-09 10:05

Long time ago .. but quite new to AppGini and thx for that !
Just have to think of changing after new generation of code.

Post Reply