View ProjeQtOr On SourceForge.net
ProjeQtOr - Project Management Tool
Support us on Capterra
OIN - Open Invention Network
ProjeQtOr free project management software - Date Time Locales - ProjeQtOr
 
 

Date Time Locales

More
09 Sep 2011 03:37 #1 by dc
Date Time Locales was created by dc
Hi,

First of all, this is looking to be a great project management tool, keep up the great work.

The issue I'm having is that while I'm using a "en" locale, the dates are "en_US"(mm/dd/yyyy) and I can't seem to find and easy way to set them to "en_AU"(dd/mm/yyyy).

Have I just missed something, or is this not implemented?

It seem dojo supports "en-au" as stated in the date module.

Maybe if you point me where you tell dojo or how you set you dates displays, and I could write a patch for us Aussies.

Cheers Mate... :-)

Please Log in or Create an account to join the conversation.

More
09 Sep 2011 15:18 #2 by babynus
Replied by babynus on topic RE : Date Time Locales
Hi,
just set you browser locale to en-au.
Dojo will display dates as expected in input fields.
Other "displayed" values will only be displayed as default en, as en-us.
I will look for an improvement on that side.
If you wish, you may change htmlFormatDate($val) in html.php to fit your needs.

Regards.

Babynus
Administrator of ProjeQtOr web site

Please Log in or Create an account to join the conversation.

More
09 Sep 2011 16:03 #3 by babynus
Replied by babynus on topic RE : Date Time Locales
Hi,
Final fixing ok for V1.8.0.

If you want to try the fixing before V1.8.0 is deployed :

in /view/js/projector.js, replace function saveBrowserLocaleToSession() with
function saveBrowserLocaleToSession() {
  browserLocale=dojo.locale;
  dojo.xhrPost({
    url: "../tool/saveDataToSession.php?id=browserLocale&value=" + browserLocale,
    load: function(data,args) { }
  });
  var date = new Date(2000, 11, 31, 0, 0, 0, 0);
  var formatted=dojo.date.locale.format(date);
  var format="YYYYMMDD";
  if (formatted.substr(0,2)=='31') {
    format='DDMMYYYY';  
  } else if (formatted.substr(0,2)=='12') {
	format='MMDDYYYY';
  }
  dojo.xhrPost({
    url: "../tool/saveDataToSession.php?id=browserLocaleDateFormat&value=" + format,
    load: function(data,args) { }
  });
}
replace function setupLocale() in /tool/projector.php with
function setupLocale () {
  global $currentLocale, $paramDefaultLocale, $browserLocale, $browserLocaleDateFormat;
  if (isset($_SESSION['currentLocale'])) {
    // First fetch in Session (filled in at login depending on user parameter)
    $currentLocale=$_SESSION['currentLocale'];
  } else if (isset($_REQUEST['currentLocale'])) {
    // Second fetch from request (for screens before user id identified)
    $currentLocale=$_REQUEST['currentLocale'];
    $_SESSION['currentLocale']=$currentLocale;
    $i18nMessages=null; // Should be null at this moment, just to be sure
  } else {
    // none of the above methods worked : get the default one form parameter file
    $currentLocale=$paramDefaultLocale;
  }
  if (isset($_SESSION['browserLocale'])) {
    $browserLocale=$_SESSION['browserLocale'];
  } else {
    $browserLocale=$currentLocale;
  }
  $_SESSION['lang']=$currentLocale; // Must be kept for user parameter screen initialization
  if (isset($_SESSION['browserLocaleDateFormat'])) {
    $browserLocaleDateFormat=$_SESSION['browserLocaleDateFormat'];
  } else {
    $browserLocale='YYYYMMDD';
  }
}
and replace function htmlFormatDate($val) in /tool/html.php
function htmlFormatDate($val) {
  global $browserLocaleDateFormat;
  if (strlen($val)!=10) {
    return $val;
  }
  if ($browserLocaleDateFormat=='MMDDYYYY') {
    return substr($val,5,2) . "/" . substr($val,8,2)  . "/" . substr($val,0,4);
  } else if ($browserLocaleDateFormat=='DDMMYYYY') {
    return substr($val,8,2) . "/" . substr($val,5,2)  . "/" . substr($val,0,4);
  } else {
  	return $val;
  }
}
Don't forget to refresh browser cache and test : it sould be better !

Regards.

Babynus
Administrator of ProjeQtOr web site

Please Log in or Create an account to join the conversation.

More
14 Sep 2011 16:30 #4 by babynus
Replied by babynus on topic RE : Date Time Locales
Fixing is included in V1.7.2, deployed today.

Babynus
Administrator of ProjeQtOr web site

Please Log in or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.035 seconds

Cookies settings

×

Functional Cookies

Ce site utilise des cookies pour assurer son bon fonctionnement et ne peuvent pas être désactivés de nos systèmes. Nous ne les utilisons pas à des fins publicitaires. Si ces cookies sont bloqués, certaines parties du site ne pourront pas fonctionner.

Session

Please login to see yours activities!

Other cookies

Ce site web utilise un certain nombre de cookies pour gérer, par exemple, les sessions utilisateurs.