IPB

Welcome Guest ( Log In | Register )

Movable Type

We're moving to movabletype.org!

At long last, we're moving to forums powered by, well, Movable Type itself. You'll want to bookmark http://forums.movabletype.org/ for future reference, and in the meantime you can view these old forums as a read-only archive of past posts. Thanks for being part of the community!

 
Reply to this topicStart new topic
> French Date format by default is wrong, Date format
KarlCow
post May 20 2002, 09:09 AM
Post #1





Group: Members
Posts: 4
Joined: 20-May 02
Member No.: 3,026



Oooopsss I have forgotten.

In french you don't say for hours smile.gif for example something like

10:30 du matin because the system is 24h

So you have 10:30 and 22:30 and it's not confusing wink.gif
Go to the top of the page
 
+Quote Post
KarlCow
post May 20 2002, 09:06 AM
Post #2





Group: Members
Posts: 4
Joined: 20-May 02
Member No.: 3,026



Hi,

I'm using Movable Type 2.0, and found the wonderful feature for the date display.

The problem is that the date format is wrong smile.gif

the display of the date at the begining of an entry have for example the format
Mai 20, 2002
Which is wrong in french, it should be
20 Mai 2002

Another thing which is wrong is the calendar format:

The first day of the week in France is Monday (Lundi) and not  Sunday smile.gif

But except of that you have a wonderful tool

is there a plan to make a french version of the environment too: menu, commands, etc?
smile.gif
Go to the top of the page
 
+Quote Post
btrott
post May 20 2002, 10:15 AM
Post #3





Group: Super Administrators
Posts: 7,068
Joined: 9-October 01
Member No.: 3,240



The format of the date in the date header is easy to change, and there isn't really a way for us to do it automatically--you can just edit the format in the <$MTEntryDate$> inside the <MTDateHeader>.

The calendar day of the week is also a bit difficult to do. smile.gif But it is on the todo list.

As for the "du matin": we used to have "du matin", but someone (I don't remember who, it was on the board a while back) said that no one used "du matin"! So we took it out. So I'm afraid you'll have to take it up with that person. smile.gif


--------------------
"And don't tell me there isn't one bit of difference between null and space, because that's exactly how much difference there is." -- Larry Wall
Go to the top of the page
 
+Quote Post
CloseGL
post Feb 10 2003, 01:49 AM
Post #4





Group: Members
Posts: 3
Joined: 21-December 02
From: Russia, Moscow
Member No.: 6,531



Good day!

No problem!  :)

1. In  lib/MT/ConfigMgr.pm adding a new line

$mgr->define('WeekStartsOnMonday', Default => 0);

after

$mgr->define('NoHTMLEntities', Default => 0);

2. In lib/MT/Util.pm file editing line 39 ($days % 7;)

and writing
($days - (MT::ConfigMgr->instance->WeekStartsOnMonday ? 1 : 0)) % 7;

3. In config file (mt.cfg) adding new line

WeekStartsOnMonday 1

4. In Templates move "Sun" to bottom:


5. Report

File "lib/MT/ConfigMgr.pm"
CODE
....
$mgr->define('NoLocking', Default => 0);
$mgr->define('NoHTMLEntities', Default => 0);
$mgr->define('WeekStartsOnMonday', Default => 0);
$mgr->define('NoPlacementCache', Default => 0);
....


File "lib/MT/Util.pm"
CODE
....
$days += $y >> 2;
$days += $In_Year[$leap][$m-1] + $d;
#$days % 7;
($days - (MT::ConfigMgr->instance->WeekStartsOnMonday ? 1 : 0)) % 7;
.....


File "mt.cfg"
CODE
....
# Week Starts On Monday
#  1 - Mon Tue Wen ...
#  0 - Sun Mon Tue ...

WeekStartsOnMonday 1
....


Templates
CODE
<tr>
<th abbr="Monday" align="center"><span class="calendar">Mon</span></th>
<th abbr="Tuesday" align="center"><span class="calendar">Tue</span></th>
<th abbr="Wednesday" align="center"><span class="calendar">Wed</span></th>
<th abbr="Thursday" align="center"><span class="calendar">Thu</span></th>
<th abbr="Friday" align="center"><span class="calendar">Fri</span></th>
<th abbr="Saturday" align="center"><span class="calendar">Sat</span></th>
<th abbr="Sunday" align="center"><span class="calendar">Sun</span></th>
</tr>


Good luck!
Go to the top of the page
 
+Quote Post
Fabien
post Feb 17 2003, 02:22 AM
Post #5





Group: Members
Posts: 15
Joined: 17-February 03
Member No.: 8,012



Hi,

I imperatively need this function. Does the previous solution work? I have not seen any site on the Web with a calendar starting on Monday. Does it exists?

Cheers, Fabien
Go to the top of the page
 
+Quote Post
Carina W-J
post Feb 17 2003, 03:14 AM
Post #6





Group: Members
Posts: 245
Joined: 10-February 03
From: Sweden
Member No.: 7,774



My calendar starts on monday with the solution above. My only problem is that the day is wrong. It is one day behind. Anyone know how to solve that?

HereYou can se for Yourself that the above thingy works.


--------------------
//Carina

My Webpage
Go to the top of the page
 
+Quote Post
bethlet
post Sep 8 2004, 03:55 AM
Post #7





Group: Members
Posts: 2
Joined: 15-May 03
Member No.: 10,959



The fix recommended by CloseGL not only works for calendars but also for the weekly archive itself. To get this to work with dynamic templates, you'll have to add a line similar to that in step 2 to the file php/lib/MTUtil.php in the wday_from_ts function.

I'm not hugely experienced in Perl so I just hardcoded the -1 instead of checking the configuration.

The line to look for is 124 and my change looked like:

## BCB: 08 Sep 04
# return $days % 7;
return ($days - 1) % 7;
## END

All of my dynamically-generated weekly templates start on a Monday now and end on a Sunday.
Go to the top of the page
 
+Quote Post
Dondo
post Feb 11 2005, 04:29 PM
Post #8





Group: Members
Posts: 1
Joined: 11-February 05
Member No.: 29,851



Thanks ColseGL!
It worked for me too!
Go to the top of the page
 
+Quote Post
lisa
post Feb 16 2006, 02:04 PM
Post #9


Technical Services


Group: Six Apart Moderators
Posts: 2,480
Joined: 30-October 05
From: Woburn, MA
Member No.: 33,515



This has changed a little for 3.2:

1) lib/MT/ConfigMgr.pm:

line 78, add:
['WeekStartsOnMonday', { Default => 0 }],


2) lib/MT/Util.pm:

line 59, change:
$days %7;

to:
($days - (MT::ConfigMgr->instance->WeekStartsOnMonday ? 1 : 0)) % 7;

Steps 3 and 4 are still correct. Save your template and rebuild and the calendar should display properly.

Disclaimer: I did not test this with dynamic publishing. Only with static.

This post has been edited by lisa: Feb 16 2006, 02:09 PM


--------------------
Go to the top of the page
 
+Quote Post
Carina W-J
post May 12 2006, 11:07 PM
Post #10





Group: Members
Posts: 245
Joined: 10-February 03
From: Sweden
Member No.: 7,774



Hi and thanks for the fix for MT 3,2 but, yes there is a but. All the dates then changed. When I have name of day in my entry it writes on day behind, that is for example yesterday was may the 12th and friday. It then writes thursday may the 12th.

I cannot figure out how to get the name of the day correct. Could someone please help me with this.

I am not using dynamic publishing only static and it is MT 3,2


--------------------
//Carina

My Webpage
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 11.24.09 - 10:41 PM