This content has been marked as final. Show 4 replies
Hello and welcome to the forum!
If you want to change the way your dates are displayed in OPA you can add the following to your application.properties file (in the Release/web-determinations/WEB-INF/classes/configuration/ folder)
output-date-format =EEE\, d MMM yyyy
This will give you a date of Fri, 5 Oct 2012.
More examples here:
(remember to put an escape character \ before a comma)
However I don't think you can tweak this to display "th", "st" etc.
Fri, 5 Oct 2012 is probably user-friendly enough and is very simple to implement... OPA can do the hard work for you and there is no code to maintain.
To do this in rules you could, as you say, do it in a rules table in Word or even in an Excel sheet...
However you would have to build a string for each date attribute that you use in the rulebase (or each date that you want to format). You could just have an excel tab for each date field and tuck it away deep in your system rules folder :-) Or you could even write a custom function that instantly builds the date string with the suffixes how you want them, and then you could have one document which then assigns these to text string for each date attribute.
If you can tweak the application.properties to display dates that you want then I'd say that's your best option but as long as you keep the rulebase organised it should be ok to use rule tables...unless anyone else knows of a way to automatically display the suffixes by tweaking the application.properties?
A possible solution is to implement a custom formatter written in Java (or .Net), this is fairly straight forward for output but you also need parse date inputs in the same format assuming these dates may be displayed as text input fields on screens rather than just labels. The online help has a good introduction and there is also some sample code, just search for 'custom format'.