0

search date in the future

Psychomoise 4 years ago 0

it is not possible to use the search engine to search date indicated in the future.

for exemple, if I want to search for certificate that will expire soon, it is not possible to indicate in the search engine a relative date like +2MONTH as only negative relative date are present

to do so, it can be easy based on how GLPI is built, just add the following in inc/html.class.php :

for ($i=1; $i<=12; $i++) {
$dates[$i.'MONTH'] = sprintf(_n('+ %d month', '+ %d months', $i), $i);
}

right after :

for ($i=1; $i<=12; $i++) {
$dates['-'.$i.'MONTH'] = sprintf(_n('- %d month', '- %d months', $i), $i);
}

the rest will do the job