Am Dienstag, 4. Februar 2014 12:58:46 UTC+1 schrieb Danielo Rodríguez:
>
> Stephan, Could you please explain me this line?
>>
>
> date.setDate(date.getDate() - 
> (DayNamesShort.length+date.getDay()-FirstDayOfWeek) % DayNamesShort.length);
>
> I can imagine what is the purpose, but I need help to fully understand it.
> Thanks in advance.
>

date is the first of the month.
DayNamesShort.length is 7 as there are 7 days in the week
date.getDay gives the weekday, a number from 0 to 6
FirstDayOfWeek is the weekday of the day which you want to be the first day 
of the week, so also 0-6

The calculation simply finds the beginning of the week of the first of the 
month.
 

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to