Advertisement:

Author Topic: Calendar - Start Of Week Day  (Read 2432 times)

Offline Ian Mc

  • Semi-Newbie
  • *
  • Posts: 33
  • Gender: Male
Calendar - Start Of Week Day
« 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.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,826
  • Gender: Male
    • Kindred-999 on GitHub
Re: Calendar - Start Of Week Day
« Reply #1 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
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 5,332
  • Gender: Male
    • i30 Owners Club
Re: Calendar - Start Of Week Day
« Reply #2 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:



VIA:



TO THIS:




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

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,980
    • StoryBB/StoryBB on GitHub
Re: Calendar - Start Of Week Day
« Reply #3 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. :(
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Ian Mc

  • Semi-Newbie
  • *
  • Posts: 33
  • Gender: Male
Re: Calendar - Start Of Week Day
« Reply #4 on: September 26, 2016, 06:25:46 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.

Offline Ian Mc

  • Semi-Newbie
  • *
  • Posts: 33
  • Gender: Male
Re: Calendar - Start Of Week Day
« Reply #5 on: September 26, 2016, 06:29:15 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.

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 5,332
  • Gender: Male
    • i30 Owners Club
Re: Calendar - Start Of Week Day
« Reply #6 on: September 26, 2016, 06:32:35 PM »
Here ya go

Offline Ian Mc

  • Semi-Newbie
  • *
  • Posts: 33
  • Gender: Male
Re: Calendar - Start Of Week Day
« Reply #7 on: September 26, 2016, 06:52:26 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 ?!?!?  ;)

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 5,332
  • Gender: Male
    • i30 Owners Club
Re: Calendar - Start Of Week Day
« Reply #8 on: September 27, 2016, 04:15:50 AM »
Sure it is. Need to edit your Settings.template.php file

Offline Ian Mc

  • Semi-Newbie
  • *
  • Posts: 33
  • Gender: Male
Re: Calendar - Start Of Week Day
« Reply #9 on: September 27, 2016, 07:50:10 AM »
Sure it is. Need to edit your Settings.template.php file

Code: [Select]
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?

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 5,332
  • Gender: Male
    • i30 Owners Club
Re: Calendar - Start Of Week Day
« Reply #10 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)

Offline Ian Mc

  • Semi-Newbie
  • *
  • Posts: 33
  • Gender: Male
Re: Calendar - Start Of Week Day
« Reply #11 on: September 27, 2016, 08:02:29 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.