Revision eb474565
Von Sven Schöling vor fast 7 Jahren hinzugefügt
js/kivi.Validator.js | ||
---|---|---|
104 | 104 |
ns.annotate($e); |
105 | 105 |
return true; |
106 | 106 |
} |
107 |
}, |
|
108 |
time: function($e) { |
|
109 |
var time_string = $e.val(); |
|
110 |
|
|
111 |
var parsed_time = kivi.parse_time(time_string); |
|
112 |
if (parsed_time === null) { |
|
113 |
$e.val(''); |
|
114 |
ns.annotate($e); |
|
115 |
return true; |
|
116 |
} else |
|
117 |
if (parsed_time === undefined) { |
|
118 |
ns.annotate($e, kivi.t8('Wrong time format (#1)', [ kivi.myconfig.timeformat ])); |
|
119 |
return false; |
|
120 |
} else |
|
121 |
{ |
|
122 |
var formatted_time = kivi.format_time(parsed_time); |
|
123 |
if (formatted_time != time_string) |
|
124 |
$e.val(formatted_time); |
|
125 |
ns.annotate($e); |
|
126 |
return true; |
|
127 |
} |
|
107 | 128 |
} |
108 | 129 |
}; |
109 | 130 |
|
Auch abrufbar als: Unified diff
Validator: time