Year range too long?

Got something cool to share with AppGini users? Feel free to post it here!
Post Reply
User avatar
shasta59
AppGini Super Hero
AppGini Super Hero
Posts: 231
Joined: 2013-01-08 19:40
Location: Calgary, Alberta, Canada

Year range too long?

Post by shasta59 » 2015-06-08 01:53

Using 5.31

If you find the range of years is too long it is easy to change.

Look in yourtablename_dml.php

Find all instances, in fields which are date fields, of MInYear = ???? and MaxYear = ????

Change the min year and max year to what you wish and this will give a much shorter possible date range. I run a program which changes all of these at one time for me.

Here is an example

$combo_date_of_game->MinYear = 2014;
$combo_date_of_game->MaxYear = 2016;

Alan
Calgary, Alberta, Canada - Using Appgini 5.50 -

AhmedBR
AppGini Super Hero
AppGini Super Hero
Posts: 327
Joined: 2013-09-19 10:23

Re: Year range too long?

Post by AhmedBR » 2015-06-08 12:52

Nice tip, thanks
AppGini 22.14 - xampp 3.3.0 - PHP 7.4.30 - Summary reports - Calendar - Mass update - Messages - AppGiniHelper

guidoc
Posts: 3
Joined: 2015-11-26 12:16
Location: Turin, Italy

Re: Year range too long?

Post by guidoc » 2015-11-28 17:50

Shasta, you said you wrote a program to change all maxYear together... I'm interested!
I'm looking for something similar in the hooks section, but I think that hooks don't help in this matter.
It seems to me that the system has a "global constant" maxYear = 2100, and it would be very useful to access to it and change it, for example to maxYear = date("Y") (the current year). But this customization should be in the AppGini preferences.

Can you give me some idea on how to change all maxYear?
Thank you!

guidoc
Posts: 3
Joined: 2015-11-26 12:16
Location: Turin, Italy

Re: Year range too long?

Post by guidoc » 2015-11-28 18:12

I found another way: modify date_combo.class.php, introduce a variable:
$this->MaxYear_custom = date("Y");
instead of
$this->MaxYear = 2100;
and replace $this->MaxYear in the rest of the file.
Then set date_combo.class.php as a read-only file, to keep the modification when regenerating the project.
It works!
You just have to remember to use this new custom variable in table_dml.php, in case you want to change the max year in that specific table view.

Post Reply