Date Custom field - change starting year

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
Sara
Posts: 3
Joined: 18 Jul 2017, 09:14

Date Custom field - change starting year

Post by Sara »

Hi Everyone,
I've a question about the use of a custom field of type "Date".
I want to have the possibility to store for year 2006 (or other year before 2012).
How can I change the range of years suggested by the system? Thanks in advance....
Sara
Attachments
datetimeCustomField.jpg
datetimeCustomField.jpg (28.19 KiB) Viewed 2953 times
atrol
Site Admin
Posts: 7875
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Date Custom field - change starting year

Post by atrol »

Add the following code to file config_inc.php and adjust it to your needs

Code: Select all

/**
 * Number of years in the past that custom date fields will display in
 * drop down boxes.
 * @global integer $g_backward_year_count
 */
$g_backward_year_count = 4;

/**
 * Number of years in the future that custom date fields will display in
 * drop down boxes.
 * @global integer $g_forward_year_count
 */
$g_forward_year_count = 4;
Please use Search before posting and read the Manual
psara
Posts: 2
Joined: 03 May 2016, 08:13

Re: Date Custom field - change starting year

Post by psara »

Thank you very much for your kind reply, It works perfectly.
Regards
Sara
Post Reply