Changeset 887 for trunk/Common/Form/Types/DateTime.php
- Timestamp:
- Nov 20, 2020, 12:08:12 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Form/Types/DateTime.php
r871 r887 5 5 class TypeDateTime extends TypeBase 6 6 { 7 var $DatabaseCompareOperators = array('Rovno' => '=', 'Nerovno' => '!=', 'Menší' => '<', 'Větší' => '>'); 7 function __construct(FormManager $FormManager) 8 { 9 parent::__construct($FormManager); 10 $this->DatabaseCompareOperators = array('Rovno' => '=', 'Nerovno' => '!=', 'Menší' => '<', 'Větší' => '>'); 11 } 8 12 9 function OnView( $Item)13 function OnView(array $Item): ?string 10 14 { 11 global $MonthNames;12 13 15 if ($Item['Value'] == 0) return ''; 14 16 if ((strtolower($Item['Value']) == 'now') or (strtolower($Item['Value']) == '')) $Item['Value'] = time(); … … 19 21 } 20 22 21 function OnEdit( $Item)23 function OnEdit(array $Item): string 22 24 { 23 25 global $MonthNames; … … 99 101 } 100 102 101 function OnLoad( $Item)103 function OnLoad(array $Item): ?string 102 104 { 103 105 if (!array_key_exists($Item['Name'].'-null', $_POST) and array_key_exists('Null', $Item) and ($Item['Null'] == true)) return null; … … 106 108 } 107 109 108 function OnLoadDb( $Item)110 function OnLoadDb(array $Item): ?string 109 111 { 110 112 return MysqlDateTimeToTime($Item['Value']); 111 113 } 112 114 113 function OnSaveDb( $Item)115 function OnSaveDb(array $Item): ?string 114 116 { 115 117 if ($Item['Value'] == null) return null; … … 117 119 } 118 120 119 function DatabaseEscape( $Value)121 function DatabaseEscape(string $Value): string 120 122 { 121 123 return '"'.addslashes($Value).'"';
Note:
See TracChangeset
for help on using the changeset viewer.