Page 1 of 1

Birthdates prior to 1900

Posted: 2018-01-09 08:13
by David Soul
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?

Re: Birthdates prior to 1900

Posted: 2018-01-10 10:52
by Celson Aquino
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.

Re: Birthdates prior to 1900

Posted: 2018-01-10 11:19
by baudwalker
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

Re: Birthdates prior to 1900

Posted: 2018-01-10 12:08
by Celson Aquino
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?

Re: Birthdates prior to 1900

Posted: 2018-01-10 13:40
by grimblefritz
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!)

Re: Birthdates prior to 1900

Posted: 2018-01-10 19:05
by David Soul
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?

Re: Birthdates prior to 1900

Posted: 2018-01-11 01:01
by baudwalker
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!

Re: Birthdates prior to 1900

Posted: 2018-01-11 03:33
by David Soul
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-)

Re: Birthdates prior to 1900

Posted: 2018-01-31 05:42
by peebee
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.

Re: Birthdates prior to 1900

Posted: 2018-12-09 10:05
by hubert
Long time ago .. but quite new to AppGini and thx for that !
Just have to think of changing after new generation of code.