You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.5 KiB
37 lines
1.5 KiB
7 years ago
|
/**
|
||
|
* Created by Urthur on 2017/7/18.
|
||
|
*/
|
||
|
Demo.CustomDateTime = BI.inherit(BI.Widget, {
|
||
|
props: {
|
||
|
},
|
||
|
render: function () {
|
||
7 years ago
|
var self = this;
|
||
7 years ago
|
return {
|
||
7 years ago
|
type: "bi.absolute",
|
||
|
items: [{
|
||
|
el: {
|
||
|
type: "bi.custom_date_time_combo",
|
||
|
ref: function (_ref) {
|
||
|
self.customDateTime = _ref;
|
||
7 years ago
|
var value, date, dateStr;
|
||
7 years ago
|
self.customDateTime.on(BI.CustomDateTimeCombo.EVENT_CONFIRM, function () {
|
||
7 years ago
|
value = this.getValue();
|
||
|
date = new Date(value.year,value.month,value.day,value.hour,value.minute,value.second);
|
||
|
dateStr = date.print("%Y-%X-%d %H:%M:%S");
|
||
|
BI.Msg.alert("日期", dateStr);
|
||
7 years ago
|
});
|
||
|
self.customDateTime.on(BI.CustomDateTimeCombo.EVENT_CANCEL, function () {
|
||
7 years ago
|
value = this.getValue();
|
||
|
date = new Date(value.year,value.month,value.day,value.hour,value.minute,value.second);
|
||
|
dateStr = date.print("%Y-%X-%d %H:%M:%S");
|
||
|
BI.Msg.alert("日期", dateStr);
|
||
7 years ago
|
});
|
||
|
}
|
||
|
},
|
||
|
top: 200,
|
||
|
left: 200
|
||
|
}]
|
||
7 years ago
|
};
|
||
|
}
|
||
|
});
|
||
|
BI.shortcut("demo.custom_date_time", Demo.CustomDateTime);
|