diff options
| author | Gunnar Mills <gmills@us.ibm.com> | 2018-04-19 15:33:40 -0500 |
|---|---|---|
| committer | Gunnar Mills <gmills@us.ibm.com> | 2018-05-04 13:02:16 -0500 |
| commit | ed96f8bb4d571ba8dc3d78bef68a3500ca494a83 (patch) | |
| tree | 217ec501d6ab94b5faa02e74ee185352719f4f72 /app/common/services | |
| parent | 3490c0fc0a70f97efff955ad0da72386e619e50a (diff) | |
| download | phosphor-webui-ed96f8bb4d571ba8dc3d78bef68a3500ca494a83.tar.gz phosphor-webui-ed96f8bb4d571ba8dc3d78bef68a3500ca494a83.zip | |
Get the BMC time
Get the BMC time from xyz/openbmc_project/time/bmc.
This time is in epoch time so convert.
Before the time and date hardcoded.
From https://docs.angularjs.org/api/ng/filter/date:
"'medium': equivalent to 'MMM d, y h:mm:ss a' for en_US locale
(e.g. Sep 3, 2010 12:05:08 PM)"
This is a similar format as to what was present on the GUI
before for en_US.
Letting the browser choose the format, is important.
Displayed in user's timezone.
Resolves openbmc/openbmc#3116
Tested: Now see correct date and time, "4/19/2018, 20:31:18 UTC"
Change-Id: Ie30c65b038b58afc8c4c77ca5b70667e80e76cc6
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
Diffstat (limited to 'app/common/services')
| -rw-r--r-- | app/common/services/api-utils.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/common/services/api-utils.js b/app/common/services/api-utils.js index 12377c5..fcd873c 100644 --- a/app/common/services/api-utils.js +++ b/app/common/services/api-utils.js @@ -897,6 +897,19 @@ window.angular && (function (angular) { return response.data; }); }, + getBMCTime: function(){ + return $http({ + method: 'GET', + url: DataService.getHost() + "/xyz/openbmc_project/time/bmc", + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json' + }, + withCredentials: true + }).then(function(response){ + return response.data; + }); + }, getHardwares: function(callback){ $http({ method: 'GET', |

