diff --git a/apps/documenteditor/mobile/src/controller/settings/DocumentInfo.jsx b/apps/documenteditor/mobile/src/controller/settings/DocumentInfo.jsx index 32fd55220..e97a7016a 100644 --- a/apps/documenteditor/mobile/src/controller/settings/DocumentInfo.jsx +++ b/apps/documenteditor/mobile/src/controller/settings/DocumentInfo.jsx @@ -6,13 +6,16 @@ class DocumentInfoController extends Component { constructor(props) { super(props); this.docProps = this.getDocProps(); - this.getModified = this.getModified(); - this.getModifiedBy = this.getModifiedBy(); - this.getCreators = this.getCreators(); - this.title = this.getTitle(); - this.subject = this.getSubject(); - this.description = this.getDescription(); - this.getCreated = this.getCreated(); + + if(this.docProps) { + this.modified = this.getModified(); + this.modifiedBy = this.getModifiedBy(); + this.creators = this.getCreators(); + this.title = this.getTitle(); + this.subject = this.getSubject(); + this.description = this.getDescription(); + this.created = this.getCreated(); + } } getDocProps() { @@ -76,6 +79,7 @@ class DocumentInfoController extends Component { getCreated() { let value = this.docProps.asc_getCreated(); + const _lang = this.props.storeAppOptions.lang; if(value) { return value.toLocaleString(_lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleTimeString(_lang, {timeStyle: 'short'}); @@ -91,10 +95,10 @@ class DocumentInfoController extends Component { return ( { const _t = t("Settings", { returnObjects: true }); const storeInfo = props.storeDocumentInfo; const dataApp = props.getAppProps(); - const dataModified = props.getModified; - const dataModifiedBy = props.getModifiedBy; - const creators = props.getCreators; - // console.log(creators); + const { pageCount, paragraphCount, @@ -19,10 +16,9 @@ const PageDocumentInfo = (props) => { symbolsWSCount, wordsCount, } = storeInfo.infoObj; + const dataDoc = JSON.parse(JSON.stringify(storeInfo.dataDoc)); - // console.log(dataDoc); const isLoaded = storeInfo.isLoaded; - // console.log(pageCount, paragraphCount, symbolsCount, symbolsWSCount, wordsCount); return ( @@ -91,27 +87,27 @@ const PageDocumentInfo = (props) => { ) : null} - {dataModified ? ( + {props.modified ? ( {_t.textLastModified} - + ) : null} - {dataModifiedBy ? ( + {props.modifiedBy ? ( {_t.textLastModifiedBy} - + ) : null} - {props.getCreated ? ( + {props.created ? ( {_t.textCreated} - + ) : null} @@ -123,12 +119,12 @@ const PageDocumentInfo = (props) => { ) : null} - {creators ? ( + {props.creators ? ( {_t.textAuthor} { - creators.split(/\s*[,;]\s*/).map(item => { + props.creators.split(/\s*[,;]\s*/).map(item => { return }) } diff --git a/apps/presentationeditor/mobile/src/controller/settings/PresentationInfo.jsx b/apps/presentationeditor/mobile/src/controller/settings/PresentationInfo.jsx index 688c76271..57d9a575e 100644 --- a/apps/presentationeditor/mobile/src/controller/settings/PresentationInfo.jsx +++ b/apps/presentationeditor/mobile/src/controller/settings/PresentationInfo.jsx @@ -1,17 +1,21 @@ import React, { Component } from "react"; import PresentationInfo from "../../view/settings/PresentationInfo"; +import { observer, inject } from "mobx-react"; class PresentationInfoController extends Component { constructor(props) { super(props); this.docProps = this.getDocProps(); - this.getModified = this.getModified(); - this.getModifiedBy = this.getModifiedBy(); - this.getCreators = this.getCreators(); - this.title = this.getTitle(); - this.subject = this.getSubject(); - this.description = this.getDescription(); - this.getCreated = this.getCreated(); + + if(this.docProps) { + this.modified = this.getModified(); + this.modifiedBy = this.getModifiedBy(); + this.creators = this.getCreators(); + this.title = this.getTitle(); + this.subject = this.getSubject(); + this.description = this.getDescription(); + this.created = this.getCreated(); + } } getDocProps() { @@ -30,17 +34,17 @@ class PresentationInfoController extends Component { getModified() { let valueModified = this.docProps.asc_getModified(); - // const _lang = this.props.storeAppOptions.lang; + const _lang = this.props.storeAppOptions.lang; if (valueModified) { return ( - valueModified.toLocaleString("en", { + valueModified.toLocaleString(_lang, { year: "numeric", month: "2-digit", day: "2-digit", }) + " " + - valueModified.toLocaleTimeString("en", { timeStyle: "short" }) + valueModified.toLocaleTimeString(_lang, { timeStyle: "short" }) ); } } @@ -71,9 +75,10 @@ class PresentationInfoController extends Component { getCreated() { let value = this.docProps.asc_getCreated(); + const _lang = this.props.storeAppOptions.lang; if(value) { - return value.toLocaleString("en", {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleTimeString("en", {timeStyle: 'short'}); + return value.toLocaleString(_lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleTimeString(_lang, {timeStyle: 'short'}); } } @@ -81,10 +86,10 @@ class PresentationInfoController extends Component { return ( { const _t = t("View.Settings", { returnObjects: true }); const storeInfo = props.storePresentationInfo; const dataApp = props.getAppProps(); - const dataModified = props.getModified; - const dataModifiedBy = props.getModifiedBy; - const creators = props.getCreators; const dataDoc = JSON.parse(JSON.stringify(storeInfo.dataDoc)); return ( @@ -72,27 +69,27 @@ const PagePresentationInfo = (props) => { ) : null} - {dataModified ? ( + {props.modified ? ( {_t.textLastModified} - + ) : null} - {dataModifiedBy ? ( + {props.modifiedBy ? ( {_t.textLastModifiedBy} - + ) : null} - {props.getCreated ? ( + {props.created ? ( {_t.textCreated} - + ) : null} @@ -104,12 +101,12 @@ const PagePresentationInfo = (props) => { ) : null} - {creators ? ( + {props.creators ? ( {_t.textAuthor} { - creators.split(/\s*[,;]\s*/).map(item => { + props.creators.split(/\s*[,;]\s*/).map(item => { return }) } diff --git a/apps/spreadsheeteditor/mobile/src/controller/settings/SpreadsheetInfo.jsx b/apps/spreadsheeteditor/mobile/src/controller/settings/SpreadsheetInfo.jsx index 37c38b3b0..573297dd3 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/settings/SpreadsheetInfo.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/settings/SpreadsheetInfo.jsx @@ -6,8 +6,8 @@ class SpreadsheetInfoController extends Component { constructor(props) { super(props); this.docProps = this.getDocProps(); + if (this.docProps) { - this.dataApp = this.getAppProps(); this.modified = this.getModified(); this.modifiedBy = this.getModifiedBy(); this.creators = this.getCreators(); @@ -15,7 +15,6 @@ class SpreadsheetInfoController extends Component { this.subject = this.getSubject(); this.description = this.getDescription(); this.created = this.getCreated(); - } } @@ -40,6 +39,7 @@ class SpreadsheetInfoController extends Component { getModified() { let valueModified = this.docProps.asc_getModified(); const _lang = this.props.storeAppOptions.lang; + if (valueModified) { return ( valueModified.toLocaleString(_lang, { @@ -81,16 +81,18 @@ class SpreadsheetInfoController extends Component { getCreated() { let value = this.docProps.asc_getCreated(); const _lang = this.props.storeAppOptions.lang; + if(value) { return value.toLocaleString(_lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleTimeString(_lang, {timeStyle: 'short'}); } + return null; } render() { return ( { const _t = t("View.Settings", { returnObjects: true }); const storeSpreadsheetInfo = props.storeSpreadsheetInfo; const dataDoc = storeSpreadsheetInfo.dataDoc; - const dataApp = props.dataApp; + const dataApp = props.getAppProps(); const dataModified = props.modified; const dataModifiedBy = props.modifiedBy; const creators = props.creators; @@ -88,11 +88,11 @@ const PageSpreadsheetInfo = (props) => { ) : null} - {props.getCreated ? ( + {props.created ? ( {_t.textCreated} - + ) : null}