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/03 07:45:53 UTC

[05/12] incubator-ponymail git commit: if end year is this year, set last month to current one

if end year is this year, set last month to current one

we don't need December if we're only in November now


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

Branch: refs/heads/coffee-and-cake
Commit: 2ddc7f3e744e5ffa6dc3a2dd0a83e15a69460a92
Parents: 43cb6cf
Author: Daniel Gruno <hu...@apache.org>
Authored: Sat Sep 3 09:40:18 2016 +0200
Committer: Daniel Gruno <hu...@apache.org>
Committed: Sat Sep 3 09:40:18 2016 +0200

----------------------------------------------------------------------
 site/js/coffee/calendar.coffee | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/2ddc7f3e/site/js/coffee/calendar.coffee
----------------------------------------------------------------------
diff --git a/site/js/coffee/calendar.coffee b/site/js/coffee/calendar.coffee
index 2492265..5dc0820 100644
--- a/site/js/coffee/calendar.coffee
+++ b/site/js/coffee/calendar.coffee
@@ -32,6 +32,9 @@ class Calendar
         ### If end year+month given, use it ###
         if end
             [eYear, eMonth] = String(end).split("-")
+            ### If end year is this year, restrict months to those that have passed ###
+            if parseInt(eYear) == now.getFullYear()
+                eMonth = now.getMonth() + 1
             
         ### Make sure months are there, otherwise set them ###
         if not sMonth