[DE] Bug 36585: fix default date format
This commit is contained in:
parent
97c1e56964
commit
8a1b9f7d29
|
@ -898,6 +898,8 @@ define([
|
||||||
me.hidePreloader();
|
me.hidePreloader();
|
||||||
me.onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
|
me.onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
|
||||||
|
|
||||||
|
Common.Utils.InternalSettings.set("de-settings-datetime-default", Common.localStorage.getItem("de-settings-datetime-default"));
|
||||||
|
|
||||||
/** coauthoring begin **/
|
/** coauthoring begin **/
|
||||||
this.isLiveCommenting = Common.localStorage.getBool("de-settings-livecomment", true);
|
this.isLiveCommenting = Common.localStorage.getBool("de-settings-livecomment", true);
|
||||||
Common.Utils.InternalSettings.set("de-settings-livecomment", this.isLiveCommenting);
|
Common.Utils.InternalSettings.set("de-settings-livecomment", this.isLiveCommenting);
|
||||||
|
|
|
@ -140,14 +140,14 @@ define([
|
||||||
callback: _.bind(function(btn) {
|
callback: _.bind(function(btn) {
|
||||||
if (btn == 'yes') {
|
if (btn == 'yes') {
|
||||||
this.defaultFormats[this.cmbLang.getValue()] = rec ? rec.get('format') : '';
|
this.defaultFormats[this.cmbLang.getValue()] = rec ? rec.get('format') : '';
|
||||||
this.api.asc_setDefaultDateTimeFormat(this.defaultFormats);
|
// this.api.asc_setDefaultDateTimeFormat(this.defaultFormats);
|
||||||
var arr = [];
|
var arr = [];
|
||||||
for (var name in this.defaultFormats) {
|
for (var name in this.defaultFormats) {
|
||||||
if (name) {
|
if (name) {
|
||||||
arr.push(name + ' ' + this.defaultFormats[name]);
|
arr.push({lang: name, format: this.defaultFormats[name]});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var value = arr.join(';');
|
var value = JSON.stringify(arr);
|
||||||
Common.localStorage.setItem("de-settings-datetime-default", value);
|
Common.localStorage.setItem("de-settings-datetime-default", value);
|
||||||
Common.Utils.InternalSettings.set("de-settings-datetime-default", value);
|
Common.Utils.InternalSettings.set("de-settings-datetime-default", value);
|
||||||
}
|
}
|
||||||
|
@ -162,11 +162,11 @@ define([
|
||||||
afterRender: function() {
|
afterRender: function() {
|
||||||
var me = this,
|
var me = this,
|
||||||
value = Common.Utils.InternalSettings.get("de-settings-datetime-default"),
|
value = Common.Utils.InternalSettings.get("de-settings-datetime-default"),
|
||||||
arr = (value) ? value.split(';') : [];
|
arr = value ? JSON.parse(value) : [];
|
||||||
this.defaultFormats = [];
|
this.defaultFormats = [];
|
||||||
arr.forEach(function(item){
|
arr.forEach(function(item){
|
||||||
var pair = item.split(' ');
|
if (item.lang)
|
||||||
me.defaultFormats[parseInt(pair[0])] = pair[1];
|
me.defaultFormats[parseInt(item.lang)] = item.format;
|
||||||
});
|
});
|
||||||
|
|
||||||
this._setDefaults();
|
this._setDefaults();
|
||||||
|
|
Loading…
Reference in a new issue