You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by hu...@apache.org on 2016/09/02 18:09:23 UTC

[2/2] incubator-ponymail git commit: don't compare string to int

don't compare string to int


Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/713ea3e6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/713ea3e6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/713ea3e6

Branch: refs/heads/coffee-and-cake
Commit: 713ea3e6ebaebc39c377a27b1139e602226f71e4
Parents: 2c77434
Author: Daniel Gruno <hu...@apache.org>
Authored: Fri Sep 2 20:09:09 2016 +0200
Committer: Daniel Gruno <hu...@apache.org>
Committed: Fri Sep 2 20:09:09 2016 +0200

----------------------------------------------------------------------
 site/js/coffee/calendar.coffee | 4 ++--
 site/js/ponymail-coffee.js     | 5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/713ea3e6/site/js/coffee/calendar.coffee
----------------------------------------------------------------------
diff --git a/site/js/coffee/calendar.coffee b/site/js/coffee/calendar.coffee
index f03544b..65fe32f 100644
--- a/site/js/coffee/calendar.coffee
+++ b/site/js/coffee/calendar.coffee
@@ -86,9 +86,9 @@ toggleYear = (div) ->
     
     ### Get the year we clicked on ###
     year = parseInt(div.getAttribute("data"))
-        
+
     ### For each year, hide if not this year, else show ###
-    for y in [sYear..eYear]
+    for y in [parseInt(sYear)..parseInt(eYear)]
         if y == year
             get('calendar_months_' + y).show(true)
         else

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/713ea3e6/site/js/ponymail-coffee.js
----------------------------------------------------------------------
diff --git a/site/js/ponymail-coffee.js b/site/js/ponymail-coffee.js
index 3f4a7df..3178e39 100644
--- a/site/js/ponymail-coffee.js
+++ b/site/js/ponymail-coffee.js
@@ -53,7 +53,7 @@ Calendar = (function() {
         if ((year > sYear || month >= sMonth) && (year < eYear || month <= eMonth)) {
           monthDiv = new HTML('div', {
             "class": "calendar_month",
-            id: "calendar_month_{#year}-{#month}",
+            id: "calendar_month_" + year + "-" + month,
             data: year + "-" + month,
             onclick: "toggleMonth(this)"
           }, calendar_months[month - 1]);
@@ -89,7 +89,8 @@ toggleYear = function(div) {
 
   /* For each year, hide if not this year, else show */
   results = [];
-  for (y = j = ref1 = sYear, ref2 = eYear; ref1 <= ref2 ? j <= ref2 : j >= ref2; y = ref1 <= ref2 ? ++j : --j) {
+  for (y = j = ref1 = parseInt(sYear), ref2 = parseInt(eYear); ref1 <= ref2 ? j <= ref2 : j >= ref2; y = ref1 <= ref2 ? ++j : --j) {
+    alert(y);
     if (y === year) {
       results.push(get('calendar_months_' + y).show(true));
     } else {