Skip to content

Commit a75ea67

Browse files
committed
Format updates when time system selected
1 parent ce5d0ef commit a75ea67

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

example/localTimeSystem/bundle.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ define([
3333
"extensions": {
3434
"formats": [
3535
{
36-
"key": "local",
36+
"key": "local-format",
3737
"implementation": LocalTimeFormat
3838
}
3939
],

example/localTimeSystem/src/LocalTimeFormat.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ define([
2626
moment
2727
) {
2828

29-
var DATE_FORMAT = "YYYY-MM-DD hh:mm:ss.SSS",
29+
var DATE_FORMAT = "YYYY-MM-DD h:mm:ss.SSS a",
3030
DATE_FORMATS = [
3131
DATE_FORMAT,
32-
"YYYY-MM-DD hh:mm:ss",
33-
"YYYY-MM-DD hh:mm",
32+
"YYYY-MM-DD h:mm:ss a",
33+
"YYYY-MM-DD h:mm a",
3434
"YYYY-MM-DD"
3535
];
3636

@@ -67,8 +67,8 @@ define([
6767
return [
6868
[".SSS", function(m) { return m.milliseconds(); }],
6969
[":ss", function(m) { return m.seconds(); }],
70-
["hh:mm", function(m) { return m.minutes(); }],
71-
["hh", function(m) { return m.hours(); }],
70+
["hh:mma", function(m) { return m.minutes(); }],
71+
["hha", function(m) { return m.hours(); }],
7272
["ddd DD", function(m) {
7373
return m.days() &&
7474
m.date() != 1;

example/localTimeSystem/src/LocalTimeSystem.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ define([
4242
*/
4343
this.metadata = {
4444
'key': 'local',
45-
'name': 'Local 12 hour',
45+
'name': 'Local',
4646
'glyph': '\u0043'
4747
};
4848

49-
this._formats = ['utc'];
49+
this._formats = ['local-format'];
5050
this._tickSources = [new LocalClock($timeout, DEFAULT_PERIOD)];
5151
}
5252

main.js

-2
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,6 @@ define([
105105
'./platform/search/bundle',
106106
'./platform/status/bundle',
107107
'./platform/commonUI/regions/bundle'
108-
//'./examples/localTimeSystem/bundle'
109-
//'./example/msl/bundle'
110108
], function (Main, legacyRegistry) {
111109
return {
112110
legacyRegistry: legacyRegistry,

platform/features/conductor-v2/conductor/src/ui/TimeConductorController.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,12 @@ define(
212212
this.$scope.timeSystemModel.options = this.selectedMode.timeSystems().map(function (timeSystem) {
213213
return timeSystem.metadata;
214214
});
215-
this.$scope.timeSystemModel.selected = timeSystem;
215+
216+
this.setTimeSystem(timeSystem);
217+
/*this.$scope.timeSystemModel.selected = timeSystem;
216218
//Use default format
217219
this.$scope.timeSystemModel.format = timeSystem.formats()[0];
218-
this.setDeltasFromTimeSystem(timeSystem);
220+
this.setDeltasFromTimeSystem(timeSystem); */
219221
}
220222
};
221223

@@ -260,6 +262,7 @@ define(
260262
TimeConductorController.prototype.setTimeSystem = function (newTimeSystem) {
261263
if (newTimeSystem && newTimeSystem !== this.$scope.timeSystemModel.selected) {
262264
this.$scope.timeSystemModel.selected = newTimeSystem;
265+
this.$scope.timeSystemModel.format = newTimeSystem.formats()[0];
263266
var mode = this.selectedMode;
264267
mode.selectedTimeSystem(newTimeSystem);
265268
this.setDeltasFromTimeSystem(newTimeSystem);

0 commit comments

Comments
 (0)