Closed GoogleCodeExporter closed 8 years ago
I am also having this problem.
Original comment by Tom.Tres...@gmail.com
on 23 Jun 2009 at 8:57
I attempted this as well in my code that has logic that looks for start dates
before
3pm. I got an XML error when I tried to use the newer file (from 2008)
Code sample:
function dateCheck(checkDate) // I use a date validator before I send date as
String
{
var refDate = Date.parse(checkDate);
var today3pm = Date.today().set({ hour: 15, minute: 0, second: 0});
if(refDate.isBefore(today3pm)) // error detected using Firebug
{ // logic here }
if(refDate.isAfter(today3pm)) // error detected using Firebug
{ // logic here }
if(refDate.compareTo(today3pm) < 0) // this is how I worked around it
{ // logic here }
}
Original comment by javase...@gmail.com
on 13 Jul 2009 at 2:17
Just ensure you are using the latest code from svn
(http://www.datejs.com/svn/). The
.isBefore and .isAfter functions were added after the Alpha-1 release.
The following test appears to work correctly when using the svn code base.
Example
var d1 = Date.today();
var d2 = Date.today().add(1).day();
console.log(d1.isAfter(d2)); // false
console.log(d1.isBefore(d2)); // true
Original comment by geoff%co...@gtempaccount.com
on 13 Jul 2009 at 6:39
Original issue reported on code.google.com by
ape...@gmail.com
on 9 Jun 2009 at 5:27