Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Ian Mc on September 26, 2016, 09:05:10 AM

Title: Calendar - Start Of Week Day
Post by: Ian Mc on September 26, 2016, 09:05:10 AM
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.
Title: Re: Calendar - Start Of Week Day
Post by: Kindred on September 26, 2016, 12:51:49 PM
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
Title: Re: Calendar - Start Of Week Day
Post by: 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:

FROM:

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fi.imgur.com%2Fj5F643N.jpg&hash=5716299928a993623e7138c5a7451260de0faea4)

VIA:

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fi.imgur.com%2F4VcFkMP.jpg&hash=0d74dcb8a532b09feb7e393b2c3013f8ccc8e34c)

TO THIS:

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FxM0foyP.jpg&hash=8ce01b023ca015b77bfe2cd416fdb2b06769f5f9)


If you'd like those lines adding for you, attach your Profile.template.php file.
Title: Re: Calendar - Start Of Week Day
Post by: 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. :(
Title: Re: Calendar - Start Of Week Day
Post by: Ian Mc on September 26, 2016, 06:25:46 PM
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.
Title: Re: Calendar - Start Of Week Day
Post by: Ian Mc on September 26, 2016, 06:29:15 PM
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.
Title: Re: Calendar - Start Of Week Day
Post by: Shambles on September 26, 2016, 06:32:35 PM
Here ya go
Title: Re: Calendar - Start Of Week Day
Post by: Ian Mc on September 26, 2016, 06:52:26 PM
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 ?!?!?  ;)
Title: Re: Calendar - Start Of Week Day
Post by: Shambles on September 27, 2016, 04:15:50 AM
Sure it is. Need to edit your Settings.template.php file
Title: Re: Calendar - Start Of Week Day
Post by: Ian Mc on September 27, 2016, 07:50:10 AM
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?
Title: Re: Calendar - Start Of Week Day
Post by: 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)
Title: Re: Calendar - Start Of Week Day
Post by: Ian Mc on September 27, 2016, 08:02:29 AM
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.