{"action":"opened","issue":{"url":"https://api.github.com/repos/OCSInventory-NG/OCSInventory-ocsreports/issues/112","repository_url":"https://api.github.com/repos/OCSInventory-NG/OCSInventory-ocsreports","labels_url":"https://api.github.com/repos/OCSInventory-NG/OCSInventory-ocsreports/issues/112/labels{/name}","comments_url":"https://api.github.com/repos/OCSInventory-NG/OCSInventory-ocsreports/issues/112/comments","events_url":"https://api.github.com/repos/OCSInventory-NG/OCSInventory-ocsreports/issues/112/events","html_url":"https://github.com/OCSInventory-NG/OCSInventory-ocsreports/issues/112","id":171674120,"number":112,"title":"Search with dates don't work","user":{"login":"cb58","id":20222556,"avatar_url":"https://avatars.githubusercontent.com/u/20222556?v=3","gravatar_id":"","url":"https://api.github.com/users/cb58","html_url":"https://github.com/cb58","followers_url":"https://api.github.com/users/cb58/followers","following_url":"https://api.github.com/users/cb58/following{/other_user}","gists_url":"https://api.github.com/users/cb58/gists{/gist_id}","starred_url":"https://api.github.com/users/cb58/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cb58/subscriptions","organizations_url":"https://api.github.com/users/cb58/orgs","repos_url":"https://api.github.com/users/cb58/repos","events_url":"https://api.github.com/users/cb58/events{/privacy}","received_events_url":"https://api.github.com/users/cb58/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-17T14:35:04Z","updated_at":"2016-08-17T14:35:04Z","closed_at":null,"body":"Hi,\r\n\r\nWith Fix #102, search with dates don't work :\r\n1. Number of agents that didn't send inventory since at least X day(s)\r\n2. Machines not seen in more than Y day(s)\r\n3. Search with various criteria\r\n\r\nI have reviewed the management of dates by OCS.\r\n\r\n```\r\ngrep 1270 `find plugins/language -type f`|sort\r\nplugins/language/brazilian_portuguese/brazilian_portuguese.txt:1270 DDMMYYYY\r\nplugins/language/english/english.txt:1270 MMDDYYYY\r\nplugins/language/french/french.txt:1270 DDMMYYYY\r\nplugins/language/german/german.txt:1270 TTMMJJJJ   => bad format for js/datetimepicker.js\r\nplugins/language/hungarian/hungarian.txt:1270 DDMMYYYY  \r\nplugins/language/italian/italian.txt:1270 DDMMYYYY\r\nplugins/language/polish/polish.txt:1270 DDMMYYYY\r\nplugins/language/portuguese/portuguese.txt:1270 DDMMYYYY\r\nplugins/language/russian/russian.txt:1270 DDMMYYYY\r\nplugins/language/slovenian/slovenian.txt:1270 DDMMYYYY\r\nplugins/language/spanish/spanish.txt:1270 DDMMYYYY\r\nplugins/language/turkish/turkish.txt:1270 DDMMYYYY\r\n```\r\n\r\n```\r\ngrep ^269 `find plugins/language -type f`|sort\r\nplugins/language/brazilian_portuguese/brazilian_portuguese.txt:269 %d/%m/%Y\r\nplugins/language/english/english.txt:269 %m/%d/%Y\r\nplugins/language/french/french.txt:269 %d/%m/%Y\r\nplugins/language/german/german.txt:269 %d/%m/%Y => bad format vs g(1270). Official format is %Y/%m/%d since 1996, but %d/%m/%Y is allowed again. See https://en.wikipedia.org/wiki/Date_format_by_country.\r\nplugins/language/hungarian/hungarian.txt:269 %Y/%m/%d => bad format vs g(1270). Official format is %Y/%m/%d, but need rewrite NewCal and FormatDate in js/datetimepicker.js. Use %d/%m/%Y as g(1270) until somebody do it.\r\nplugins/language/italian/italian.txt:269 %d/%m/%Y\r\nplugins/language/polish/polish.txt:269 %m/%d/%R  => bad format. See https://en.wikipedia.org/wiki/Date_and_time_notation_in_Poland  => %d/%m/%Y\r\nplugins/language/portuguese/portuguese.txt:269 %d/%m/%Y\r\nplugins/language/russian/russian.txt:269 %m/%d/%Y => bad format vs g(1270)  => %d/%m/%Y\r\nplugins/language/slovenian/slovenian.txt:269 %d/%m/%Y\r\nplugins/language/spanish/spanish.txt:269 %d/%m/%Y\r\nplugins/language/turkish/turkish.txt:269 %m/%d/%Y => bad format vs g(1270). See https://en.wikipedia.org/wiki/Date_and_time_notation_in_Turkey => %d/%m/%Y\r\n```\r\n[turkish.txt.diff.txt](https://github.com/OCSInventory-NG/OCSInventory-ocsreports/files/422788/turkish.txt.diff.txt)\r\n[russian.txt.diff.txt](https://github.com/OCSInventory-NG/OCSInventory-ocsreports/files/422785/russian.txt.diff.txt)\r\n[polish.txt.diff.txt](https://github.com/OCSInventory-NG/OCSInventory-ocsreports/files/422787/polish.txt.diff.txt)\r\n[hungarian.txt.diff.txt](https://github.com/OCSInventory-NG/OCSInventory-ocsreports/files/422789/hungarian.txt.diff.txt)\r\n[german.txt.diff.txt](https://github.com/OCSInventory-NG/OCSInventory-ocsreports/files/422786/german.txt.diff.txt)\r\n\r\n\r\n\r\nThe function compair_with_date() in function_search.php assume :\r\n1. date separator is -\r\n2. local date format is same mysql date format.\r\n\r\n[function_search.php.diff.txt](https://github.com/OCSInventory-NG/OCSInventory-ocsreports/files/422791/function_search.php.diff.txt)\r\n\r\n \r\ndateOnClick() and datePick() assume that there are only two formats dates.\r\n\r\n[function_table_html.php.diff.txt](https://github.com/OCSInventory-NG/OCSInventory-ocsreports/files/422793/function_table_html.php.diff.txt)\r\n\r\n\r\ndateTimeFromMysql() and dateToMysql() assume :\r\n1. local date format is same mysql date format ;\r\n2. only two dates formats.\r\n\r\ndateToMysql() is not used => remove it. \r\n\r\n[function_commun.php.diff.txt](https://github.com/OCSInventory-NG/OCSInventory-ocsreports/files/422795/function_commun.php.diff.txt)\r\n\r\n\t\t \r\nIn ms_custom_pack.php, add %Y/%m/%d format :\r\n\r\n[ms_custom_pack.php.diff.txt](https://github.com/OCSInventory-NG/OCSInventory-ocsreports/files/422796/ms_custom_pack.php.diff.txt)\r\n\r\n\r\nIn ms_all_computers.php, add a comment to understand the date format :\r\n\r\n[ms_all_computers.php.diff.txt](https://github.com/OCSInventory-NG/OCSInventory-ocsreports/files/422798/ms_all_computers.php.diff.txt)\r\n\r\n\r\nTODO : Do not use YYYYMMDD format until rewrite NewCal() and FormatDate() in js/datetimepicker.js. \r\n\r\nThe patches has been validated with OCS in English and French.\r\n\r\nRegards,"}}
{"actor":{"display_login":"cb58"}}