Project:Table Manager
Version:4.7.x-1.x-dev
Component:Miscellaneous
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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

Comments

#1

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

#2

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

#3

Status:active» fixed

#4

Status:fixed» closed (fixed)