altf4
Posts: 1035
Joined: Mon Feb 04, 2008 8:05 pm
Location: Thailand
Contact: Website

Date format in Vehicle Tracker

Sat Mar 22, 2008 6:56 am

is there any "quicK" way to change the way the date is displayed in the device-list ?

if a date is displayed its looks like "08-03-21"

YY-MM-DD .. well a machine may like it, but a human (specially here in thailand) identify this as unreadable information.

hope there is some way to sort this out .. (change to DD.MM.YY) quickly ..
due some big presentation next week

--
Backups are for WIMPS!

User avatar
Fredrik
Posts: 1155
Joined: Fri Mar 02, 2007 1:04 pm
Location: Sweden
Contact: Website

RE: Date format in Vehicle Tracker

Sat Mar 22, 2008 5:58 pm

Hi,
See getShortItemDate in vehicletrackermain.js. It is responsible for formatting the date/time in the device list. Currently it calls MochiKit.DateTime.toISODate/Time (see http://www.mochikit.com/doc/html/MochiKit/DateTime.html). Simply replace this with the formatting of your choice.
We're aware of the need to be able to customize date & time formatting as part of localization, we'll try to expose this as a setting in a future release.

Regards,
Fredrik

Franson Support

altf4
Posts: 1035
Joined: Mon Feb 04, 2008 8:05 pm
Location: Thailand
Contact: Website

RE: Date format in Vehicle Tracker

Sat Mar 22, 2008 8:27 pm

-EDIT-
got it ;-)

here a sample to display the date like DD.MM.YY

Code: Select all

//		return MochiKit.DateTime.toISODate(time).substr(2);
		var yy = MochiKit.DateTime.toISODate(time).substr(2);
		var day2 = yy.substr(6,2);
		var month2 = yy.substr(3,2);
		var year2 = yy.substr(0,2)
		var date2 = day2 + '.' + month2 + '.' + year2;
		return date2;

Return to “GpsGate Server - How to setup and use”