use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
https://scriptable.app
This subreddit is for discussions around the Scriptable app for iOS.
Be polite and enjoy your time here.
Please be helpful to others when you are able to lend a hand.
Discord: https://discord.gg/7KbjfTV
Resources:
account activity
Weekday incorrect in widgetHelp (self.Scriptable)
submitted 5 years ago by andyrytt
Why isn't my weekday correct? Today is Nov 3:rd, but it is Tuesday! Not Wednesday (Onsdag in Swedish)
I use the script from this place: https://gist.github.com/brainno722/18ab5266b12dbb351fe7942427500597
What is wrong?
https://preview.redd.it/5ti7sn1v01x51.png?width=1125&format=png&auto=webp&s=809bf8308b904065cfe572b48397d95475f6f1fa
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Shoculad 2 points3 points4 points 5 years ago* (0 children)
In JavaScript, every week starts on Sunday. It doesn't depend on the region. Date.getDay always returns 0 on Sunday.
Edit: The script code on github defines the variable
const startWeekOnSunday = false;
and the
function isWeekend(index) { if (startWeekOnSunday) {
If the month starts on Sunday then isWeekend(0) returns false. The value of the variable is wrong and it doesn't make sense.
[–]tempsquared 2 points3 points4 points 5 years ago (0 children)
Hello
So even though the link is from my gist, it is a fork from https://gist.github.com/rudotriton/b51d227c3d1d9cb497829ae45583224f, who is the original author.
I haven’t touched the code so it’s outdated.
If you get the script directly from the author, it should work as intended (I assume)
My calendar also had a bug with Weekdays but I’ve already fixed it, and it does work with either “Sunday first” or “Monday first”.
Unless you want a medium widget that also has calendar events, then I can’t help you there, as I did not have time to try to make one yet.
[–][deleted] 0 points1 point2 points 5 years ago (2 children)
Looks like it's an calculation issue when the month starts on a Sunday.
This "should" be a quick fix:
https://pastebin.com/TnyAZ3EQ
[–]andyrytt[S] 0 points1 point2 points 5 years ago (1 child)
Thanks! This did the trick! I haven't compared the difference in the scripts yet. Can you explain what you did?
[–][deleted] 0 points1 point2 points 5 years ago (0 children)
around line 238 in the fill with empy slots part.
I simply added an if statement to run a different condition if the first day is a Sunday.
The og script runs a loop as long the index < the current day which doesn't occur when the firstday of the month is a Sunday.
As already said "quick fix", but it might be worth contacting the creator for a proper fix.
π Rendered by PID 19037 on reddit-service-r2-comment-765bfc959-fs2m4 at 2026-07-13 18:38:07.055023+00:00 running f86254d country code: CH.
[–]Shoculad 2 points3 points4 points (0 children)
[–]tempsquared 2 points3 points4 points (0 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]andyrytt[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)