Use null for empty Date
review13391003
This commit is contained in:
1 parent
661946a1c3
commit
5decda2998
2 files changed
+10
-4
No files matched your search
+5
-2
@@ -127,8 +127,11 @@
|
||||
};
|
||||
|
||||
Sao.common.parse_datetime = function(date_format, time_format, value) {
|
||||
var date = Sao.DateTime(
|
||||
jQuery.datepicker.parseDate(date_format, value));
|
||||
value = jQuery.datepicker.parseDate(date_format, value);
|
||||
if (!value) {
|
||||
return null;
|
||||
}
|
||||
var date = Sao.DateTime(value);
|
||||
var time_value = value.replace(jQuery.datepicker.formatDate(
|
||||
date_format, date), '').trim();
|
||||
var time = Sao.common.parse_time(time_format, time_value);
|
||||
|
||||
+5
-2
@@ -1232,8 +1232,11 @@
|
||||
set_client: function(record, value, force_change) {
|
||||
if (typeof value == 'string') {
|
||||
try {
|
||||
value = Sao.Date(jQuery.datepicker.parseDate(
|
||||
Sao.common.date_format(), value));
|
||||
value = jQuery.datepicker.parseDate(
|
||||
Sao.common.date_format(), value);
|
||||
if (value) {
|
||||
value = Sao.Date(value);
|
||||
}
|
||||
} catch (e) {
|
||||
value = this._default;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user