Opened 3 months ago

Closed 3 months ago

Last modified 3 months ago

#663 closed enhancement (fixed)

SelectionPanel: Allow date/time display formatting to be customizable.

Reported by: jng Owned by: jng
Priority: P2 Milestone: Future
Component: Widgets Version: 2.0
Severity: Major Keywords:
Cc: Browser: All
External ID: Operating System: All
state: New

Description

Currently this defaults to yyyy-mm-dd hh:mm:ss, the default locale-neutral wire format used by the mapagent.

Change History (2)

comment:1 Changed 3 months ago by jng

Resolution: fixed
Status: assignedclosed

In 3045:

Add support for specifying a custom date/time formatter function in the SelectionPanel? widget. An example usage (format as d/m/y) would involve inserting something like this in the FUSION_INITIALIZED handler function.

Fusion.Widget.SelectionPanel?.setDateTimeFormatter(function(dateStr) {

if (dateStr) {

var tokens = dateStr.split(" ");
if (tokens.length == 2) {

var dtParts = tokens[0].split("-");
var y = dtParts[0];
var m = dtParts[1];
var d = dtParts[2];
return d + "/" + m + "/" + y;

}

}
return "";

});

Fixes #663

comment:2 Changed 3 months ago by jng

In 3046:

Merged revision(s) 3045 from trunk:
Add support for specifying a custom date/time formatter function in the SelectionPanel? widget. An example usage (format as d/m/y) would involve inserting something like this in the FUSION_INITIALIZED handler function.

Fusion.Widget.SelectionPanel?.setDateTimeFormatter(function(dateStr) {

if (dateStr) {

var tokens = dateStr.split(" ");
if (tokens.length == 2) {

var dtParts = tokens[0].split("-");
var y = dtParts[0];
var m = dtParts[1];
var d = dtParts[2];
return d + "/" + m + "/" + y;

}

}
return "";

});

Fixes #663
........

Note: See TracTickets for help on using tickets.