diff options
author | Sukanya Pandey <sukapan1@in.ibm.com> | 2020-08-04 22:22:28 +0300 |
---|---|---|
committer | Derick Montague <derick.montague@ibm.com> | 2020-08-08 07:48:06 +0300 |
commit | 5a705962a8d3e972e0dd3c837f6177cf8f3a5f97 (patch) | |
tree | 14b0795b16df312e9d523deebaf63daf7a7976dc /src/views/Configuration | |
parent | fcda20013b8836e171a91c8c47c584449ffd7746 (diff) | |
download | webui-vue-5a705962a8d3e972e0dd3c837f6177cf8f3a5f97.tar.xz |
Remove bug in date and time settings page
-In UTC preference the month was getting added by +1 and this code will
resolve the issue.
Signed-off-by: Sukanya Pandey <sukapan1@in.ibm.com>
Change-Id: I835f62b4151e7429e31d07ff3933f46242e08ec3
Diffstat (limited to 'src/views/Configuration')
-rw-r--r-- | src/views/Configuration/DateTimeSettings/DateTimeSettings.vue | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/views/Configuration/DateTimeSettings/DateTimeSettings.vue b/src/views/Configuration/DateTimeSettings/DateTimeSettings.vue index 3d9dc3b6..e10c9ea5 100644 --- a/src/views/Configuration/DateTimeSettings/DateTimeSettings.vue +++ b/src/views/Configuration/DateTimeSettings/DateTimeSettings.vue @@ -388,7 +388,9 @@ export default { const timeArray = time.split(':'); let utcDate = Date.UTC( datesArray[0], // User input year - datesArray[1], // User input month + //UTC expects zero-index month value 0-11 (January-December) + //for reference https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC#Parameters + parseInt(datesArray[1]) - 1, // User input month datesArray[2], // User input day timeArray[0], // User input hour timeArray[1] // User input minute |