Skip to content

Commit

Permalink
fix for off-by-one bug on months in datetime.py, by russell yanofsky
Browse files Browse the repository at this point in the history
git-svn-id: https://pyjamas.svn.sourceforge.net/svnroot/pyjamas/trunk@2396 7a2bd370-bda8-463c-979e-2900ccfb811e
  • Loading branch information
lkcl committed Feb 7, 2010
1 parent 27e2d5a commit 501aef2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Changes made to Pyjamas since 0.6
---------------------------------

* Off-by-one bug in datetime on months, fixed by Russell Yanofsky

* Fix for menu highlighting by Pavel Mironchyk

* Add initial port of python logging module
Expand Down
1 change: 1 addition & 0 deletions CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Bill Winder <wgwinder@gmail.com>
Niki Spahiev
flerda (http://code.google.com/u/flerda/)
Davorin Kunstelj (http://code.google.com/u/davorin.kunstelj/)
Russell Yanofsky <russell@yanofsky.org>


Erik gets a special mention for the contribution of the "Showcase".
Expand Down
1 change: 1 addition & 0 deletions copyright
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Copyright: 2010 Niki Spahiev
Copyright: 2010 flerda (http://code.google.com/u/flerda/)
Copyright: 2010, Tobias Weber <tobi-weber@gmx.de>
Copyright: 2010 Davorin Kunstelj (http://code.google.com/u/davorin.kunstelj/)
Copyright: 2010 Russell Yanofsky <russell@yanofsky.org>

Files: examples/flowpanel/*
Copyright: 2009 jordonwii (http://code.google.com/u/jordonwii)
Expand Down
12 changes: 6 additions & 6 deletions pyjs/src/pyjs/lib/datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ def __init__(self, year=None, month=None, day=None, hours=None, minutes=None, se
raise NontImplementedError("tzinfo")
JS("""
if (microseconds !== null)
self.date = new Date(year, month, day, hours, minutes, seconds, 0.5+microseconds/1000.0);
self.date = new Date(year, month-1, day, hours, minutes, seconds, 0.5+microseconds/1000.0);
else if (seconds !== null)
self.date = new Date(year, month, day, hours, minutes, seconds);
self.date = new Date(year, month-1, day, hours, minutes, seconds);
else if (minutes !== null)
self.date = new Date(year, month, day, hours, minutes);
self.date = new Date(year, month-1, day, hours, minutes);
else if (hours !== null)
self.date = new Date(year, month, day, hours);
self.date = new Date(year, month-1, day, hours);
else if (day !== null)
self.date = new Date(year, month, day);
self.date = new Date(year, month-1, day);
else if (month !== null)
self.date = new Date(year, month);
self.date = new Date(year, month-1);
else if (year !== null)
{
if (pyjslib.isNumber(year))
Expand Down

0 comments on commit 501aef2

Please sign in to comment.