mirror of
https://github.com/nasa/openmct.git
synced 2025-06-17 14:48:13 +00:00
[Plugins] Bring over timeline, clock plugins
WTD-1239
This commit is contained in:
38
platform/features/clock/src/indicators/ClockIndicator.js
Normal file
38
platform/features/clock/src/indicators/ClockIndicator.js
Normal file
@ -0,0 +1,38 @@
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
['moment'],
|
||||
function (moment) {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Indicator that displays the current UTC time in the status area.
|
||||
* @implements Indicator
|
||||
*/
|
||||
function ClockIndicator(tickerService, CLOCK_INDICATOR_FORMAT) {
|
||||
var text = "";
|
||||
|
||||
tickerService.listen(function (timestamp) {
|
||||
text = moment.utc(timestamp).format(CLOCK_INDICATOR_FORMAT) + " UTC";
|
||||
});
|
||||
|
||||
return {
|
||||
getGlyph: function () {
|
||||
return "C";
|
||||
},
|
||||
getGlyphClass: function () {
|
||||
return "";
|
||||
},
|
||||
getText: function () {
|
||||
return text;
|
||||
},
|
||||
getDescription: function () {
|
||||
return "";
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
return ClockIndicator;
|
||||
}
|
||||
);
|
Reference in New Issue
Block a user