News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Calendar - Start Of Week Day

Started by Ian Mc, September 26, 2016, 09:05:10 AM

Previous topic - Next topic

Ian Mc

Is it possible to start the day of the week on a Thursday?  I have found the options for changing the start day of the week but Thursday is not one of them (no surprise as it is an odd day!).

The purpose of this is the members who use the forum are all from the same company and their week runs from Thursday to Thursday. Being able to do this would sync the calendars week number with the companies week number.

Thanks in advance.

Kindred

not without code changes...   weeks either run Sun-Sun or Mon-Mon (depending on your country standards)

Thu-Thu is not a standard anywhere that I know. :P
So, you would have to change the code. It could be done, but would require updates in probably in a dozen or more places
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Shambles

Just 4 lines need adding to Profile.template.php to enable the full spectrum of days:

FROM:



VIA:



TO THIS:




If you'd like those lines adding for you, attach your Profile.template.php file.

Arantor

This will have some occasional issues in terms of calculating the week number and can occasionally fail to show you events on certain days. :(

Ian Mc

Quote from: Shambles on September 26, 2016, 01:38:07 PM
Just 4 lines need adding to Profile.template.php to enable the full spectrum of days:

If you'd like those lines adding for you, attach your Profile.template.php file.

OK thank you. File attached.

Ian Mc

Quote from: Arantor on September 26, 2016, 01:39:53 PM
This will have some occasional issues in terms of calculating the week number and can occasionally fail to show you events on certain days. :(

Have set displaying week number to false so hopefully that won't be an issue? Will see how we go with events.

Worth trying as without week starting on a Thursday I can't really use the calendar for what is required anyway so nothing to lose!

Many thanks.

Shambles


Ian Mc

Quote from: Shambles on September 26, 2016, 06:32:35 PM
Here ya go

That worked a treat thank you very much.

Is it possible to add code to set that as the forum default via the drop down box in Admin> Current Theme> Member Options  or am I just asking too much now ?!?!?  ;)

Shambles

Sure it is. Need to edit your Settings.template.php file

Ian Mc

Quote from: Shambles on September 27, 2016, 04:15:50 AM
Sure it is. Need to edit your Settings.template.php file


array(
'id' => 'calendar_start_day',
'label' => $txt['calendar_start_day'],
'options' => array(
0 => $txt['days'][0],
1 => $txt['days'][1],
6 => $txt['days'][6],
),
'default' => true,
),



Looking at it I assume I just enter the extra variables at this point?

Shambles

Yep, starting with "4" if you want to preselect Thursday.

I do appreciate people trying to work things out for themselves, so well done  8)

Ian Mc

Quote from: Shambles on September 27, 2016, 07:53:16 AM
Yep, starting with "4" if you want to preselect Thursday.

I do appreciate people trying to work things out for themselves, so well done  8)

Again, worked a treat thank you for your time. Once I know where to look I'm not too bad, but just needed a poke with a stick in the right direction with this one !!

Thanks again. Much appreciated.

Advertisement: