Customizing SMF > SMF Coding Discussion

ISO week numbers

(1/5) > >>

This is in response to
but I'm not allowed to post attachments there.
I have made a mod to replace the US style week numbering in the calender with the ISO 8601 week numbering standard.
It seems to sort of work, but no guarantees, since this is my first mod.
I'm aware of at least one bug.

Hello andershz!

I'm posting here to remember the topic! :)

A bit better, but I wouldn't use it in flight control operations just yet...

Marcus Forsberg:
Have you submitted this to the mod site? :)

Not yet, I'm waiting to see if I get any feedback on this first.
I might be on the completely wrong track with this mod since I'm new to SMF development.
If it appears to work reasonably well for someone else than me then I'll submit it.

Also, I'm considering rewriting it in a different way.
Currently the week number is calculated separately in two different places, one for the week view and one for the first week in the month view.
Then in the month view the week number is incremented by one for each row which creates a lot of special cases around new year.
It might be better to make one function that calculates the correct week number for a given day and call it every time a week number is needed.



[0] Message Index

[#] Next page

Go to full version