[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Freeipa-devel] [PATCH] 118 Fixed host enrollment time



The month in krblastpwdchange (LDAP Generalized Time) is 1-based
but the month in JavaScript Date.setUTCFullYear() is 0-based so it
needs a conversion.

Ticket 1053

--
Endi S. Dewata
From 0e6d2b9a2610267f1d2b6ec3c3453f8855b05130 Mon Sep 17 00:00:00 2001
From: Endi S. Dewata <edewata redhat com>
Date: Fri, 4 Mar 2011 09:34:46 -0600
Subject: [PATCH] Fixed host enrollment time

The month in krblastpwdchange (LDAP Generalized Time) is 1-based
but the month in JavaScript Date.setUTCFullYear() is 0-based so it
needs a conversion.

Ticket 1053
---
 install/ui/host.js |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/install/ui/host.js b/install/ui/host.js
index 9ef7553e950d3cde5f22ca1a966067c445f6acd7..7d9e8f018848c6b0fe66ab0c8f4f4f47f7d4ee65 100644
--- a/install/ui/host.js
+++ b/install/ui/host.js
@@ -126,13 +126,13 @@ IPA.utc_date_column_format = function(value){
     var date = new Date();
 
     date.setUTCFullYear(
-        value.substring(0, 4),
-        value.substring(4, 6),
-        value.substring(6, 8));
+        value.substring(0, 4),    // YYYY
+        value.substring(4, 6)-1,  // MM (0-11)
+        value.substring(6, 8));   // DD (1-31)
     date.setUTCHours(
-        value.substring(8, 10),
-        value.substring(10, 12),
-        value.substring(12, 14));
+        value.substring(8, 10),   // HH (0-23)
+        value.substring(10, 12),  // MM (0-59)
+        value.substring(12, 14)); // SS (0-59)
     var formated = date.toString();
     return  formated;
 };
-- 
1.6.6.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]