From b8f99385a5eb3a4461014f95f33d2e086973917d Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 7 Aug 2006 20:17:33 +0000 Subject: [PATCH] moved to Number object to prevent parseInt failures git-svn-id: svn://svn.open-ils.org/ILS/trunk@5340 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/common/js/utils.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Open-ILS/web/opac/common/js/utils.js b/Open-ILS/web/opac/common/js/utils.js index 62c9f5d75c..7f1976f83b 100644 --- a/Open-ILS/web/opac/common/js/utils.js +++ b/Open-ILS/web/opac/common/js/utils.js @@ -590,14 +590,23 @@ function buildDate( year, month, day, hours, minutes, seconds ) { if(!seconds) seconds = 0; var d = new Date(year, month - 1, day, hours, minutes, seconds); + + _debug('created date with ' + + (d.getYear() + 1900) +'-'+ + (d.getMonth() + 1) +'-'+ + d.getDate()+' '+ + d.getHours()+':'+ + d.getMinutes()+':'+ + d.getSeconds()); + if( (d.getYear() + 1900) == year && d.getMonth() == (month - 1) && - d.getDate() == parseInt(day) && - d.getHours() == parseInt(hours) && - d.getMinutes() == parseInt(minutes) && - d.getSeconds() == parseInt(seconds) ) { + d.getDate() == new Number(day) && + d.getHours() == new Number(hours) && + d.getMinutes() == new Number(minutes) && + d.getSeconds() == new Number(seconds) ) { return d; } -- 2.11.0