It would be nice to have a field that allows to set the date format in other languages than English.

Comments

pobster’s picture

Yeah s'easy enough; change this line in tablemanager_display;

            case "3": // Date
              $exp = explode('/', $a);
              $temp[] = array('data' => '<!-- '.$a.' -->'.date(variable_get('tablemanager_date_format', 'jS F Y'), mktime(0, 0, 0, $exp['1'], $exp['2'], $exp['0'])));
              break;

To;

            case "3": // Date
              $exp = explode('/', $a);
              setlocale(LC_TIME, "de_DE"); // German
              $temp[] = array('data' => '<!-- '.$a.' -->'.strftime(variable_get('tablemanager_date_format', 'jS F Y'), mktime(0, 0, 0, $exp['1'], $exp['2'], $exp['0'])));
              break;

You'll need to set the date format (on your settings page, NOT in the code here) to something from here; http://www.php.net/manual/en/function.strftime.php

(for an example try "%A %d %B %Y" which will output for instance, Friday 22 December 1978 in whatever language you've set the locale to).

Let me know if this works as it should as I can't test it on my server (functionality not installed...)

Pobster

chris.gr’s picture

Thanks a lot, it worked. I added
setlocale(LC_TIME, "de_DE.UTF8"); // German
and set the date format according to your link.

pobster’s picture

Status: Active » Fixed
pobster’s picture

Status: Fixed » Closed (fixed)
prorva’s picture

I am using 000webhost.com and I can not find this settings (probably functionality not installed)
I want to change date language to russian.

Any help?

pobster’s picture

Which version of Drupal are you using? This issue is related to 4.7 - are you really still using this?