Jump to content

Can't get PW to output German month names


totoff

Recommended Posts

Have you tried using another embed option? Does the localization works in the backend (i.e. form builder preview)? Could you provide us with a little more info, because it's really hard debugging/helping without the right information.

Perhaps you could make a screencap of what you are doing.

Link to comment
Share on other sites

  • 1 year later...

Heads up:
after going through all the posts here I still couldn't get german month names to work. Reason for that was the configuration of the output formatting

WRONG: date output format j. F Y results in 18. July 2017

RIGHT: date output format %e. %B %G results in 18. Juli 2017

The field description also states »Alternatively, you may use a PHP strftime format if desired for localization.« So I guess RTFM :-/

  • Like 3
Link to comment
Share on other sites

  • 1 month later...
Quote

WRONG: date output format j. F Y results in 18. July 2017

RIGHT: date output format %e. %B %G results in 18. Juli 2017

nice! That was just what was wrong here at my place. 
I think the datetime field should handle that automatically somehow!?

Link to comment
Share on other sites

  • 4 years later...

Hi guys, 5 years later…

for separating the date components from a date field, I found this solution. This works fine.

<?php
   $d = strtotime($page->datefield);
   echo date('d', $d) . '<br>'; //e.g 8
   echo date('F Y', $d); //e.g. November 2015
?>

But I want to germanize the output. I tried this:

<?php
   setlocale(LC_ALL, 'de_DE.UTF-8');
   $d = strftime("%d. %B %G", strtotime($veranstaltung->datefield));
   echo date('%d.', $d) . '<br>';
   echo date('%B', $d);
?>

But I'm getting an error: A non well formed numeric value encountered

In my config.php I have these lines:

$config->timezone = 'Europe/Berlin';
setlocale(LC_ALL, 'de_DE.UTF-8');

 

I don't know, if these settings from the date field are correct

Bildschirmfoto 2022-05-30 um 12.01.06.jpg

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...