diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index 67fcdb4c3..eb5ab2551 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -1525,8 +1525,15 @@ define([ this.coreProps = (this.api) ? this.api.asc_getCoreProps() : null; if (this.coreProps) { var value = this.coreProps.asc_getCreated(); - if (value) - this.lblDate.text(value.toLocaleString(this.mode.lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(this.mode.lang, {timeStyle: 'short'})); + if (value) { + var lang = (this.mode.lang || 'en').replace('_', '-').toLowerCase(); + try { + this.lblDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); + } catch (e) { + lang = 'en'; + this.lblDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); + } + } this._ShowHideInfoItem(this.lblDate, !!value); } else if (pdfProps) this.updatePdfInfo(pdfProps); @@ -1544,8 +1551,16 @@ define([ if (props) { var visible = false; value = props.asc_getModified(); - if (value) - this.lblModifyDate.text(value.toLocaleString(this.mode.lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(this.mode.lang, {timeStyle: 'short'})); + + if (value) { + var lang = (this.mode.lang || 'en').replace('_', '-').toLowerCase(); + try { + this.lblModifyDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); + } catch (e) { + lang = 'en'; + this.lblModifyDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); + } + } visible = this._ShowHideInfoItem(this.lblModifyDate, !!value) || visible; value = props.asc_getLastModifiedBy(); if (value) @@ -1586,7 +1601,13 @@ define([ value = props.CreationDate; if (value) { value = new Date(value); - this.lblDate.text(value.toLocaleString(this.mode.lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(this.mode.lang, {timeStyle: 'short'})); + var lang = (this.mode.lang || 'en').replace('_', '-').toLowerCase(); + try { + this.lblDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); + } catch (e) { + lang = 'en'; + this.lblDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); + } } this._ShowHideInfoItem(this.lblDate, !!value); @@ -1594,7 +1615,13 @@ define([ value = props.ModDate; if (value) { value = new Date(value); - this.lblModifyDate.text(value.toLocaleString(this.mode.lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(this.mode.lang, {timeStyle: 'short'})); + var lang = (this.mode.lang || 'en').replace('_', '-').toLowerCase(); + try { + this.lblModifyDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); + } catch (e) { + lang = 'en'; + this.lblModifyDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); + } } visible = this._ShowHideInfoItem(this.lblModifyDate, !!value) || visible; visible = this._ShowHideInfoItem(this.lblModifyBy, false) || visible; diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index 83593ed40..bc3690f07 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -1215,8 +1215,15 @@ define([ this.coreProps = (this.api) ? this.api.asc_getCoreProps() : null; if (this.coreProps) { var value = this.coreProps.asc_getCreated(); - if (value) - this.lblDate.text(value.toLocaleString(this.mode.lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(this.mode.lang, {timeStyle: 'short'})); + if (value) { + var lang = (this.mode.lang || 'en').replace('_', '-').toLowerCase(); + try { + this.lblDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); + } catch (e) { + lang = 'en'; + this.lblDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); + } + } this._ShowHideInfoItem(this.lblDate, !!value); } }, @@ -1241,8 +1248,15 @@ define([ if (props) { var visible = false; value = props.asc_getModified(); - if (value) - this.lblModifyDate.text(value.toLocaleString(this.mode.lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(this.mode.lang, {timeStyle: 'short'})); + if (value) { + var lang = (this.mode.lang || 'en').replace('_', '-').toLowerCase(); + try { + this.lblModifyDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); + } catch (e) { + lang = 'en'; + this.lblModifyDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); + } + } visible = this._ShowHideInfoItem(this.lblModifyDate, !!value) || visible; value = props.asc_getLastModifiedBy(); if (value) diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 910242136..4f1f37aea 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -1945,12 +1945,19 @@ define([ case Asc.c_oAscError.ID.FillAllRowsWarning: var fill = errData[0], have = errData[1], - fillWithSeparator = fill.toLocaleString(this.appOptions.lang); + lang = (this.appOptions.lang || 'en').replace('_', '-').toLowerCase(), + fillWithSeparator; + try { + fillWithSeparator = fill.toLocaleString(lang); + } catch (e) { + lang = 'en'; + fillWithSeparator = fill.toLocaleString(lang); + } if (this.appOptions.isDesktopApp && this.appOptions.isOffline) { config.msg = fill > have ? Common.Utils.String.format(this.textFormulaFilledAllRowsWithEmpty, fillWithSeparator) : Common.Utils.String.format(this.textFormulaFilledAllRows, fillWithSeparator); config.buttons = [{caption: this.textFillOtherRows, primary: true, value: 'fillOther'}, 'close']; } else { - config.msg = fill >= have ? Common.Utils.String.format(this.textFormulaFilledFirstRowsOtherIsEmpty, fillWithSeparator) : Common.Utils.String.format(this.textFormulaFilledFirstRowsOtherHaveData, fillWithSeparator, (have - fill).toLocaleString(this.appOptions.lang)); + config.msg = fill >= have ? Common.Utils.String.format(this.textFormulaFilledFirstRowsOtherIsEmpty, fillWithSeparator) : Common.Utils.String.format(this.textFormulaFilledFirstRowsOtherHaveData, fillWithSeparator, (have - fill).toLocaleString(lang)); config.buttons = ['ok']; } config.maxwidth = 400; diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 9049bd9d6..b39b9267c 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -1590,8 +1590,15 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ this.coreProps = (this.api) ? this.api.asc_getCoreProps() : null; if (this.coreProps) { var value = this.coreProps.asc_getCreated(); - if (value) - this.lblDate.text(value.toLocaleString(this.mode.lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(this.mode.lang, {timeStyle: 'short'})); + if (value) { + var lang = (this.mode.lang || 'en').replace('_', '-').toLowerCase(); + try { + this.lblDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); + } catch (e) { + lang = 'en'; + this.lblDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); + } + } this._ShowHideInfoItem(this.lblDate, !!value); } }, @@ -1616,8 +1623,15 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ if (props) { var visible = false; value = props.asc_getModified(); - if (value) - this.lblModifyDate.text(value.toLocaleString(this.mode.lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(this.mode.lang, {timeStyle: 'short'})); + if (value) { + var lang = (this.mode.lang || 'en').replace('_', '-').toLowerCase(); + try { + this.lblModifyDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); + } catch (e) { + lang = 'en'; + this.lblModifyDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); + } + } visible = this._ShowHideInfoItem(this.lblModifyDate, !!value) || visible; value = props.asc_getLastModifiedBy(); if (value)