From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id cHblLpC+M2TQAwEASxT56A (envelope-from ) for ; Mon, 10 Apr 2023 09:45:20 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 2J8ELpC+M2S45QAAG6o9tA (envelope-from ) for ; Mon, 10 Apr 2023 09:45:20 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0084D3903B for ; Mon, 10 Apr 2023 09:45:19 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1plmCV-0003Ch-4f; Mon, 10 Apr 2023 03:44:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1plmCS-0003CY-2E for emacs-orgmode@gnu.org; Mon, 10 Apr 2023 03:44:28 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1plmCQ-0004GN-9y for emacs-orgmode@gnu.org; Mon, 10 Apr 2023 03:44:27 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 41C5924019C for ; Mon, 10 Apr 2023 09:44:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1681112663; bh=G3YVygINXYYuQK0XMYhkUAWjOMb7EfN+awxGvIJBwKg=; h=From:To:Cc:Subject:Date:From; b=Zi1cNQzJUan71uHS3gUc6Ptb1jMgFzcWW5r2PXvrEwpsYtRqIVEv9Td7/XbfdajIm GS9yoB0kW4/P9mBJhWNXq9fRkxAORuUMEetzAxIEvTuNVDaHVEx3LArmNIYEJnRB4y o9jeuycnL8a7Pa2RqrJcsYGHtPLpNqYHPLIb0PPrjufug6sRjYsBnh7PfOdhAonvzS kXEPB9AgPqSRczzyY/JOVf53UkkMkaBFUecVeoOg0C1L/NjfxmU1gNTDJeKy/7qAiG 8VZbHV9wSi6R0TcLO0L0xMCQ5SYtls7KIDsWuRe1Vv94GLkxgfTg7dZ/GI1hJc76We pMvS9hcvB6QDg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Pw1Ff5WnDz9rxK; Mon, 10 Apr 2023 09:44:22 +0200 (CEST) From: Ihor Radchenko To: Marcin Borkowski Cc: Org-Mode mailing list Subject: Re: What is a week? In-Reply-To: <87fs981izf.fsf@mbork.pl> References: <87h6to1ka7.fsf@mbork.pl> <87fs981izf.fsf@mbork.pl> Date: Mon, 10 Apr 2023 07:46:38 +0000 Message-ID: <87ile4yyap.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1681112720; a=rsa-sha256; cv=none; b=FTTWbkAFxBpSFOICvl2xTzPN7qNkyRf0E/KxjPX4ocejfomCa8sbD2qkk6A5oVedrb9CYL bu73glBXQdXhjfsPcOQM+eighSNga28dKa3ncBrl3rhYQL5Mh7jn2ly6Ufn6t0IH+vNaZb rzaqucSiENxIqu61tH14PvlPQv6hbqMYYgOgWr4Bg1CvTURO0Z9CK7RaD8KhTjfi389IPB zmr/OMN4wdLPOjx1daD2MCbSZvPB+MRov4/ZGjVBJ6v6MnRSDWHGdFGrPjDuYjS4sHzm6N d8M0jv0elkqQ21S+0HYfY7jxoGdJ8OrpV3jjqXvyjJLwJAiVaTqAl3GcCVqUGw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Zi1cNQzJ; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1681112720; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=itG21vsZbW/ATxv+mbkz2C6zDOdrR++gctmONK3HFjM=; b=tGMFhVr+1Go4PJmZ2cpBSR2Zzoxoqn0EV26MzyjHVSf8Avm3mB/6heUAqgOT/l/5dxvCAs lvcVGpBQeUkI4bTvjpVxQHIi/B92/9W4u605EL+2F3Rh4k2EGl9EwK/6k86CIdkAapZnMH ZPBUjHXHyAFLfalmEi8m+0NLSf58Doj+qKdiAgENXHrgXn7hfr7bZy8tJXoczqXh7NUhEj 2Z7mAkRvLsVxVY9CTPumxr9FZ4xIwB5ctglYX7Mps9z3TikAaR3IKARuIyaACDBEfsClEI Md+VBGOXryRs11RWgX//HNiir37G/mORquN/TvXU4L6ih5nBsnq4MAgh3f92vQ== Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Zi1cNQzJ; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -7.32 X-Spam-Score: -7.32 X-Migadu-Queue-Id: 0084D3903B X-TUID: pU2dO+Z5g3c+ Marcin Borkowski writes: >> Assume it's Sunday. I create a clock table with :wstart 0 and >> thisweek - and apparently my clock table starts 7 days ago. >> >> Now it's Monday. I create a clock table with :wstart 1 and thisweek - >> and my clock table starts today. >> >> What is the logic behind it? > > To clarify: I understand that the reason is the `if' from this line from > `org-clock.el': > > (setq diff (+ (* -7 shift) (if (= dow 0) (- 7 ws) (- dow ws))) > > (introduced ~10 years ago!). But why is it coded this way? The commit goes like 0bca49801eac749b6adf39b176b9455566faac85 Author: Bastien Guerry org-clock.el: Implement a new parameter :wstart to define the week start day - (setq diff (+ (* -7 shift) (if (= dow 0) 6 (1- dow))) + (setq diff (+ (* -7 shift) (if (= dow 0) (- 7 ws) (- dow ws))) I am not sure if there is any particular reason. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at