emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Dale Sedivec <dale@codefu.org>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: emacs-orgmode@gnu.org
Subject: Re: Bug: clocktable interprets tstart/tend incorrectly, maybe? [9.0.9 (9.0.9-636-gd39ccc-elpaplus @ /tmp/emacs/.emacs.d/elpa/org-plus-contrib-20170709/)]
Date: Sat, 15 Jul 2017 01:15:55 -0500	[thread overview]
Message-ID: <CAEj9N4J4uA6myaUkuq1ge27v0YnbLuUeUOmD=fHxF6-s8_OoBw@mail.gmail.com> (raw)
In-Reply-To: <87tw2kwtut.fsf@nicolasgoaziou.fr>


[-- Attachment #1.1: Type: text/plain, Size: 1630 bytes --]

On Mon, Jul 10, 2017 at 3:59 AM, Nicolas Goaziou <mail@nicolasgoaziou.fr>
wrote:

> Hello,
>
> Dale Sedivec <dale@codefu.org> writes:
>
[...]

> > I notice that as of 112c5ba479d, org-clocktable-steps parses :tstart and
> > :tend with the ZONE argument to org-parse-time-string as T.  I think this
> > is causing org-parse-time-string to parse these user-entered dates as UTC
> > rather than the user's local time as I would have expected.  Changing
> > org-clocktable-steps from doing (org-parse-time-string ts nil t)
> > to (org-parse-time-string ts nil nil), and then the same for te as well,
> > seems to fix this problem.
>
> Fixed. Thank you for the report and the analysis.
>

Thank you as always Nicolas!  You fixed the time zone for :tstart in
60eda8e4ec4.  However, I think the parsing of :tend (locally bound as te)
eight lines below that needs the same fix.  Diff attached this time, just
to demonstrate what I'm talking about.  (Sorry I don't send more patches,
but I have not updated my copyright assignment to reflect my new employer.)

Steps to reproduce:

* Start Emacs 25.1 in an empty $HOME with TZ=America/Chicago

* Install org-mode HEAD

* Insert the following into an org-mode buffer and update the dblock:

~~~~~~
* Test
  :LOGBOOK:
  CLOCK: [2017-07-15 Sat 00:01]--[2017-07-15 Sat 01:01] =>  1:00
  :END:
#+BEGIN: clocktable :maxlevel 2 :scope subtree :tstart "<2017-07-09 Sun>"
:tend "<2017-07-16 Sun>" :step day
#+END:
~~~~~~

Expected result: The last step in the clock table for 2017-07-15 shows 1
hour

Actual result: The last step in the clock table for 2017-07-15 shows 0 hours

Thanks again,
Dale

[-- Attachment #1.2: Type: text/html, Size: 2623 bytes --]

[-- Attachment #2: org-clocktable-end-fix.diff --]
[-- Type: text/plain, Size: 659 bytes --]

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 8e04aec2dd..4164c92aba 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -2710,8 +2710,7 @@ LEVEL is an integer.  Indent by two spaces per level above 1."
       (pcase-let ((`(,month ,day ,year) (calendar-gregorian-from-absolute te)))
 	(setq te (float-time (encode-time 0 0 0 day month year)))))
      (te
-      (setq te (float-time
-		(apply #'encode-time (org-parse-time-string te nil t))))))
+      (setq te (float-time (apply #'encode-time (org-parse-time-string te))))))
     (setq tsb
 	  (if (eq step0 'week)
 	      (- ts (* 86400 (- (nth 6 (decode-time (seconds-to-time ts))) ws)))

  reply	other threads:[~2017-07-15  6:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-09 20:46 Bug: clocktable interprets tstart/tend incorrectly, maybe? [9.0.9 (9.0.9-636-gd39ccc-elpaplus @ /tmp/emacs/.emacs.d/elpa/org-plus-contrib-20170709/)] Dale Sedivec
2017-07-10  8:59 ` Nicolas Goaziou
2017-07-15  6:15   ` Dale Sedivec [this message]
2017-07-24  7:43     ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAEj9N4J4uA6myaUkuq1ge27v0YnbLuUeUOmD=fHxF6-s8_OoBw@mail.gmail.com' \
    --to=dale@codefu.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).