Changeset 874 for trunk/Common/Form/Types/Date.php
- Timestamp:
- Apr 6, 2020, 11:56:19 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Form/Types/Date.php
r873 r874 11 11 global $MonthNames; 12 12 13 if ($Item['Value'] == null) return ('');13 if ($Item['Value'] == null) return ''; 14 14 if ((strtolower($Item['Value']) == 'now') or (strtolower($Item['Value']) == '')) $Item['Value'] = time(); 15 15 $Parts = getdate($Item['Value']); 16 16 17 17 $Output = $Parts['mday'].'.'.$Parts['mon'].'.'.$Parts['year']; 18 return ($Output);18 return $Output; 19 19 } 20 20 … … 71 71 } 72 72 $Output .= '</select>'; 73 return ($Output);73 return $Output; 74 74 } 75 75 76 76 function OnLoad($Item) 77 77 { 78 if (!array_key_exists($Item['Name'].'-null', $_POST) and array_key_exists('Null', $Item) and ($Item['Null'] == true)) return (null);79 else return (mktime(0, 0, 0, $_POST[$Item['Name'].'-month'], $_POST[$Item['Name'].'-day'], $_POST[$Item['Name'].'-year']));78 if (!array_key_exists($Item['Name'].'-null', $_POST) and array_key_exists('Null', $Item) and ($Item['Null'] == true)) return null; 79 else return mktime(0, 0, 0, $_POST[$Item['Name'].'-month'], $_POST[$Item['Name'].'-day'], $_POST[$Item['Name'].'-year']); 80 80 } 81 81 82 82 function OnLoadDb($Item) 83 83 { 84 return (MysqlDateToTime($Item['Value']));84 return MysqlDateToTime($Item['Value']); 85 85 } 86 86 87 87 function OnSaveDb($Item) 88 88 { 89 if ($Item['Value'] == null) return (null);90 else return (date('Y-m-d', $Item['Value']));89 if ($Item['Value'] == null) return null; 90 else return date('Y-m-d', $Item['Value']); 91 91 } 92 92 93 93 function DatabaseEscape($Value) 94 94 { 95 return ('"'.addslashes($Value).'"');95 return '"'.addslashes($Value).'"'; 96 96 } 97 97 }
Note:
See TracChangeset
for help on using the changeset viewer.