From 5f4e33e16040412edf3dbe34866a467429a9b37c Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 5 Sep 2015 19:59:31 +1200 Subject: Global standards locale preferences --- web/app/Resources.js | 5 ++++- web/app/view/report/Report.js | 10 +++++++--- web/app/view/state/StateController.js | 2 ++ 3 files changed, 13 insertions(+), 4 deletions(-) (limited to 'web/app') diff --git a/web/app/Resources.js b/web/app/Resources.js index 73cee7b2d..3454ab579 100644 --- a/web/app/Resources.js +++ b/web/app/Resources.js @@ -20,11 +20,14 @@ var styles = { windowWidth: 640, windowHeight: 480, + dateTimeFormat: 'Y-m-d H:i:s', + timeFormat: 'H:i', + weekStartDay: 1, + deviceWidth: 350, reportHeight: 250, reportTime: 100, - reportFormat: 'Y-m-d H:i:s', mapDefaultLat: 51.507222, mapDefaultLon: -0.1275, diff --git a/web/app/view/report/Report.js b/web/app/view/report/Report.js index 535be942b..8b86b9cc7 100644 --- a/web/app/view/report/Report.js +++ b/web/app/view/report/Report.js @@ -44,23 +44,27 @@ Ext.define('Traccar.view.report.Report', { }, { xtype: 'datefield', reference: 'fromDateField', - value: new Date() + startDay: styles.weekStartDay, + value: new Date(new Date().getTime() - 30 * 60 * 1000) }, { xtype: 'timefield', reference: 'fromTimeField', maxWidth: styles.reportTime, - value: new Date() + format: styles.timeFormat, + value: new Date(new Date().getTime() - 30 * 60 * 1000) }, '-', { xtype: 'tbtext', html: strings.reportTo }, { xtype: 'datefield', reference: 'toDateField', + startDay: styles.weekStartDay, value: new Date() }, { xtype: 'timefield', reference: 'toTimeField', maxWidth: styles.reportTime, + format: styles.timeFormat, value: new Date() }, '-', { text: strings.reportShow, @@ -76,7 +80,7 @@ Ext.define('Traccar.view.report.Report', { columns: [ { text: strings.positionValid, dataIndex: 'valid', flex: 1 }, - { text: strings.positionTime, dataIndex: 'fixTime', flex: 1, xtype: 'datecolumn', format: styles.reportFormat }, + { text: strings.positionTime, dataIndex: 'fixTime', flex: 1, xtype: 'datecolumn', format: styles.dateTimeFormat }, { text: strings.positionLatitude, dataIndex: 'latitude', flex: 1 }, { text: strings.positionLongitude, dataIndex: 'longitude', flex: 1 }, { text: strings.positionAltitude, dataIndex: 'altitude', flex: 1 }, diff --git a/web/app/view/state/StateController.js b/web/app/view/state/StateController.js index 73dc28b50..c027dddc9 100644 --- a/web/app/view/state/StateController.js +++ b/web/app/view/state/StateController.js @@ -96,6 +96,8 @@ Ext.define('Traccar.view.state.StateController', { var speedUnits = Ext.getStore('SpeedUnits'); unit = Traccar.getApplication().getUser().get('speedUnit') || Traccar.getApplication().getServer().get('speedUnit') || ''; value = speedUnits.convert(value, unit) + ' ' + speedUnits.getUnitName(unit); + } else if (value instanceof Date) { + value = Ext.Date.format(value, styles.dateTimeFormat); } store.add(Ext.create('Traccar.model.Parameter', { -- cgit v1.2.3