[DE] Insert date-time

This commit is contained in:
Julia Radzhabova 2020-03-06 14:18:01 +03:00
parent b20217d187
commit f628ca5668
2 changed files with 13 additions and 20 deletions

View file

@ -2986,7 +2986,7 @@ define([
handler: function(result, value) { handler: function(result, value) {
if (result == 'ok') { if (result == 'ok') {
if (me.api) { if (me.api) {
// me.api.asc_addDateTime(value); me.api.asc_addDateTime(value);
} }
} }
Common.NotificationCenter.trigger('edit:complete', me.toolbar); Common.NotificationCenter.trigger('edit:complete', me.toolbar);

View file

@ -173,7 +173,7 @@ define([
}, },
_setDefaults: function () { _setDefaults: function () {
// this.props = new AscCommonSlide.CAscDateTime(); this.props = new Asc.CAscDateTime();
if (this.lang) { if (this.lang) {
var item = this.cmbLang.store.findWhere({value: this.lang}); var item = this.cmbLang.store.findWhere({value: this.lang});
item = item ? item.get('value') : 0x0409; item = item ? item.get('value') : 0x0409;
@ -187,21 +187,19 @@ define([
}, },
updateFormats: function(lang) { updateFormats: function(lang) {
return;
this.props.put_Lang(lang); this.props.put_Lang(lang);
var data = this.props.get_DateTimeExamples(), var formats = this.props.get_FormatsExamples(),
arr = []; arr = [];
var store = this.listFormats.store; var store = this.listFormats.store;
for (var name in data) { for (var i = 0, len = formats.length; i < len; i++)
if (data[name]) { {
var rec = new Common.UI.DataViewModel(); var rec = new Common.UI.DataViewModel();
rec.set({ rec.set({
format: name, format: formats[i],
value: data[name] value: this.props.get_String(formats[i], undefined, lang)
}); });
arr.push(rec); arr.push(rec);
} }
}
store.reset(arr); store.reset(arr);
var format = this.defaultFormats[lang]; var format = this.defaultFormats[lang];
format ? this.listFormats.selectRecord(store.findWhere({format: format})) : this.listFormats.selectByIndex(0); format ? this.listFormats.selectRecord(store.findWhere({format: format})) : this.listFormats.selectByIndex(0);
@ -211,14 +209,9 @@ define([
}, },
onSelectFormat: function(lisvView, itemView, record) { onSelectFormat: function(lisvView, itemView, record) {
return;
if (!record) return; if (!record) return;
if (this.chUpdate.getValue()=='checked') { this.props.put_Format(record.get('format'));
this.props.put_DateTime(record.get('format')); this.props.put_Update(this.chUpdate.getValue()=='checked');
} else {
this.props.put_DateTime(null);
this.props.put_CustomDateTime(record.get('value'));
}
}, },
onBtnClick: function(event) { onBtnClick: function(event) {