Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4733C200D09 for ; Tue, 12 Sep 2017 13:35:44 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 45D9A1609C7; Tue, 12 Sep 2017 11:35:44 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8C44A1609C6 for ; Tue, 12 Sep 2017 13:35:43 +0200 (CEST) Received: (qmail 469 invoked by uid 500); 12 Sep 2017 11:35:42 -0000 Mailing-List: contact commits-help@ponymail.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ponymail.incubator.apache.org Delivered-To: mailing list commits@ponymail.incubator.apache.org Received: (qmail 460 invoked by uid 99); 12 Sep 2017 11:35:41 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Sep 2017 11:35:41 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 6BE321A281B for ; Tue, 12 Sep 2017 11:35:41 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.222 X-Spam-Level: X-Spam-Status: No, score=-4.222 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id R-95LmYun-kc for ; Tue, 12 Sep 2017 11:35:39 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 9B3B25F640 for ; Tue, 12 Sep 2017 11:35:38 +0000 (UTC) Received: (qmail 429 invoked by uid 99); 12 Sep 2017 11:35:37 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Sep 2017 11:35:37 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0E40FF5724; Tue, 12 Sep 2017 11:35:36 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sebb@apache.org To: commits@ponymail.incubator.apache.org Message-Id: <43a0838bc30b4d0aaee2b756bef5d270@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: incubator-ponymail git commit: Bug: stats.lua should use UTC for calculating year and month Date: Tue, 12 Sep 2017 11:35:36 +0000 (UTC) archived-at: Tue, 12 Sep 2017 11:35:44 -0000 Repository: incubator-ponymail Updated Branches: refs/heads/master 5ee25e85b -> 75e3dd18c Bug: stats.lua should use UTC for calculating year and month This fixes #409 Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/75e3dd18 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/75e3dd18 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/75e3dd18 Branch: refs/heads/master Commit: 75e3dd18c07f3dfecf4130989193dcd7d0d0c292 Parents: 5ee25e8 Author: Sebb Authored: Tue Sep 12 12:35:32 2017 +0100 Committer: Sebb Committed: Tue Sep 12 12:35:32 2017 +0100 ---------------------------------------------------------------------- CHANGELOG.md | 1 + site/api/stats.lua | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/75e3dd18/CHANGELOG.md ---------------------------------------------------------------------- diff --git a/CHANGELOG.md b/CHANGELOG.md index d8091c3..f62dfcd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ ## CHANGES in 0.10: +- Bug: stats.lua should use UTC for calculating year and month (#409) - Bug: atom.lua - should generate date in UTC, not local time (#408) - Bug: shorten links does not work with cluster ids (#406) - Drop lid from 'cluster' hash - it's already in the id (#400) http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/75e3dd18/site/api/stats.lua ---------------------------------------------------------------------- diff --git a/site/api/stats.lua b/site/api/stats.lua index 0c14932..b9c913f 100644 --- a/site/api/stats.lua +++ b/site/api/stats.lua @@ -487,12 +487,12 @@ function handle(r) end end - -- extract years and months for response - datespan.firstYear = tonumber(os.date("%Y", first)) - datespan.firstMonth = tonumber(os.date("%m", first)) + -- extract years and months for response (using UTC, i.e. leading !) + datespan.firstYear = tonumber(os.date("!%Y", first)) + datespan.firstMonth = tonumber(os.date("!%m", first)) - datespan.lastYear = tonumber(os.date("%Y", last)) - datespan.lastMonth = tonumber(os.date("%m", last)) + datespan.lastYear = tonumber(os.date("!%Y", last)) + datespan.lastMonth = tonumber(os.date("!%m", last)) -- Debug time point 4 if DEBUG then