I am using Swedish Locale and have configured and setup Swedish date formats and everything is translated. All seems to work well apart from that the Date changer ignores my Locale and displays the date with the English Locale. Meaning, If I click the Date changer, I get the mini calendar popup (note: the mini calendar popup interface gets translated correctly) and select a date, the date gets inserted into the field, and it looks ok with the right Swedish locale but once you click »Change date« the date in the Date changers input field changes to the English locale. So for October 15 2009, the Date changer input field should say: 15 okt 2009, but what I get is 15 Oct 2009 which is in English with the English date format. As well, the help text underneath the Date changer (Format: 15 Oct 2009) can not be translated.

I am using:

Date 6.x-2.2
Drupal 6.12
Calendar 6.x-2.1

Thanks, Fridge

CommentFileSizeAuthor
#6 date.patch2.54 KBBodo Maass

Comments

armage’s picture

Project: Calendar » Date
Version: 6.x-2.1 » 6.x-2.2
Component: User interface » Date Popup

I have exactly the same problem. And I don't use Calendar module so I guess the pb comes from Date module...

Edit:
Pb description : i'm using a cck date field. When the user first fills the form in, everything is ok. But when he wants to modify, the date field is pre-filled with english formated data instead of french formated. The popup displays correct french translation of month.

--
Armage

gunzip’s picture


When the user first fills the form in, everything is ok. But when he wants to modify, the date field is pre-filled with english formated data instead of french formated.

same here

petiar’s picture

When the user first fills the form in, everything is ok. But when he wants to modify, the date field is pre-filled with english formated data instead of slovak formated.

Same issue here. It is happening also with node preview. The solution is to set up the input date format so it only contains numbers (e.g. 28/06/2009 - 12:00). ;-)

asb’s picture

Hi,

I have a similar issue in one D6 installation that was migrated from D5. The solution from #3 does not work here, in fresh D6 sites I haven't yet encountered the issue.

Greetings, -asb

melian’s picture

Hi

I've found a solution for these bugs :

In date_popup.module

Line :

'#default_value' => (!empty($element['#value']['date']) || !empty($edit['date'])) && is_object($date) ? date_format($date, $date_format) : '',

Becomes

'#default_value' => (!empty($element['#value']['date']) || !empty($edit['date'])) && is_object($date) ? date_format_date($date, 'custom', $date_format)  : '',

Line :

$sub_element['#description'] = ' '. t('Format: @date', array('@date' => date($date_format, time())));

Becomes

$sub_element['#description'] = ' '. t('Format: @date', array('@date' => date_format_date( date_make_date( date($date_format, time())), 'custom', $date_format)) );

In date_api_elements.inc

Line :

$element['date']['#default_value'] = is_object($date) ? date_format($date , $element['#date_format']) : '';

Becomes

$element['date']['#default_value'] = is_object($date) ? date_format_date($date, "custom", $element['#date_format'])  : '';

Line

$element['date']['#description'] = ' '. t('Format: @date', array('@date' => date($element['#date_format'], time())));

Becomes

$element['date']['#description'] = ' '. t('Format: @date', array('@date' => date_format_date(  date_make_date(date($element['#date_format'], time())), "custom", $element['#date_format'])));

Regards
CM

Bodo Maass’s picture

Version: 6.x-2.2 » 6.x-2.x-dev
Status: Active » Reviewed & tested by the community
StatusFileSize
new2.54 KB

The code changes from #5 fixed this problem for me. Without them, the date changer was not useable with the site language set to German. Attached is a real patch.

asb’s picture

glueckskind’s picture

I can confirm, that patch #6 fixes the problem.

mattis’s picture

Works here as well, thanks.

I'd like to see this included in the next release, as it forces users to select the date again every time they edit a node.

jasperknops’s picture

The patch in comment #6 does the job!
As mattis said, would be nice if it would be in the next release.

karens’s picture

Status: Reviewed & tested by the community » Fixed

Finally got this committed. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.