Date/time formatting functions

Donate to this project

Development Project Status: Completed

Total cost estimate (ex-Tax): 
$355
Due date for completion of this stage: 
22/03/2013
Release: 
1.7
Current Percentage Funded: 
100.00%
Project funding: 

Public pledges can be made to this forum topic or email me directly by clicking here (link only works in the forum). Development will not commence until fully funded.

Project description: 

At present, archetypes and reports can format dates using the following xpath functions:

  • date:formatDate(value) - formats a date using the locale's MEDIUM format
  • date:formatDate(value, style) - formats a date using the style - one of "short", "medium", "long"
  • date:formatTime(value) - formats a time using the locale's MEDIUM format
  • date:formatTime(value, style) - formats a time using the style - one of "short", "medium", "long"
  • date:formatDateTime(value) - formats a date/time using the locale's MEDIUM format
  • date:formatDateTime(value, style) - formats a date/time using the style - one of "short", "medium", "long"
  • date:formatDateTime(value, dateStyle, timeStyle) - formats a date/time using the specified styles

This project will add an xpath function to that specifies a pattern for the format, to provide fine-grain control over how dates and times are presented. This will use the pattern from the SimpleDateFormat class.

E.g.:

  • date:format(value, "dd/MM/yyyy h:mm a")  - "21/03/2013 9:32 AM"
  • date:format(value,  "EEE, MMM d") - "Fri, Mar 23"

 

JIRA: https://openvpms.atlassian.net/browse/OBF-223

Syndicate content