Welcome, Guest. Please login or register.
Did you miss your activation email?
May 24, 2012, 11:18:56 PM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155473 Posts in 21708 Topics by 7734 Members
Latest Member: rofroodoOvego
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: calendarDateInput(): change first day of week from sunday to monday  (Read 1078 times)
Jiriki

Offline Offline

Posts: 11


« on: December 10, 2008, 02:00:54 AM »

Hey folks,

My client asks for changing the calendar's days order in the "news" module. He wants the calendar columns headed by M, T, W, T, F, S, S instead of S, M, T, W, T, F, S, S, which means that the first column shopuld contain all mondays of the month.
I watched the parameters of DateInput() and the user variables of calendarDateInput.j s but there is nothing according to the problem.
Is there some way to change the order easily?

Thanks a lot!
Logged
SourDough

Offline Offline

Posts: 47


WWW
« Reply #1 on: December 10, 2008, 05:45:29 PM »

If you only want to change it for the News module - Modify Post page, find the following code in the modify_post.php file (should be around line 53):

// include jscalendar-setup
$jscal_use_time = true; // whether to use a clock, too
require_once(WB_PATH."/include/jscalendar/wb-setup.php");

Add this, where x is the day of the week you wish to start on, i.e. 1 for monday:

$jscal_firstday = "x";

That will change it for only the News module - Modify Post page.

Nick

EDIT:

FYI, if you want to change this site-wide, locate the following file:
/wb-directory/include/jscalendar/wb-setup.php

and change the variables $jscal_firstday on lines 52 and 54 to the start day you wish (Sun=0, Mon=1, Tue=2, etc.)




« Last Edit: December 10, 2008, 05:55:26 PM by SourDough » Logged
Jiriki

Offline Offline

Posts: 11


« Reply #2 on: December 11, 2008, 06:41:17 PM »

Too bad i cannot find this particular file even if i search with the allmighty Windows search engine. Perhaps it is due to the used WB version? The client has installed version 2.6.7 . Another reason could be that the former Webdesign Company removed that file.

Thanks nevertheless
Logged
SourDough

Offline Offline

Posts: 47


WWW
« Reply #3 on: December 11, 2008, 08:41:00 PM »

My apologies.  I assumed that you were talking about WB 2.7. 

From what I recall, WB 2.6.7 didn't include the calendar popup, or even beginning and end dates in the news module.  Perhaps some modifications have been made to the default WB installation? 

Doing a quick Google search for the functions you mentioned in your original post lead me to believe that someone added the Date Input script found here:

http://calendar.moonscript.com/dateinput.cfm

If so, it appears that the day names, i.e. S M T W T F S, are set in an array at the beginning of the script.  You could try changing the values in the array to reflect what you want, but I suspect that it will only affect the heading and not the actual day numbers; basically the day names and day numbers wouldn't match up. 

I would suggest that you have your client upgrade to WB 2.7 since this feature is included by default. 

Sorry I couldn't be of more help.

Nick
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!