Start of Week setting


#1

I had assumed that TP would use my Macs system setting for the start of the week. Having tested this out I have found that it doesn’t.

Will this change?

My week starts Monday so all relative dates and calculations are out. Something that should show in this week, doesn’t. This is rather crucial for me.

If TP won’t pick up the system setting for start of the week would you consider adding an option; as a number of apps do; letting the user select Sunday or Monday?


#2

FWIW in JavaScript for Automation we can read the user’s

System Preferences > Language & Region > First day of week setting

with:

(function () {
   
    return ['Sat', 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri'][
        parseInt($.NSCalendar.currentCalendar.firstWeekday, 10)
    ];

})();

#3

My week starts Monday so all relative dates and calculations are out

Just for clarification – are you mainly talking about queries/searches which involve the word ‘week’ ?


#4

Yes. If I have a task for this Sunday it does not show up in tasks for this week.


#5

So with next week bound to a midnight moment 24h before you want, you might, as an interim measure, be able to rewrite queries by appending +1d ?

e.g.

@due <=[d] next week

–>

@due <=[d] next week +1d

Or perhaps something like:

@due <[d] mon +7d

or

@due <[d] tue +7d

#6

The library that I’m using for date manipulation is Moment.js, which is a JavaScript library that I guess is not tied deeply into OS X. So that’s why it’s not respecting your “First day of week” setting.

I just experimented and if I change the local that Moment.js uses then (depending on local) it will work as you ask. Unfortunately I’m not really sure how (and if I want to get into) to map from OS X local to Moment.js. I think it could turn into a mess quickly.

Instead I noticed that Moment can also work with isoweek instead of week and when using isoweek … starts on Monday! So I think what I’m going to do for now is add support for isoweek to my parser. Then you can use that to get the behavior that you want.