Date formatting issues

Kevin Stembridge's Avatar

Kevin Stembridge

13 Mar, 2012 07:29 PM

Hi all,
I have some users reporting that dates in the forecaster extension are not formatted correctly according to their locale. So far all of these users (3 of them) are in the UK locale but dates are formatted as though they are in the US locale. Other dates in Moneydance itself are formatted correctly. 2 of the users are on macs, the third has not provided any system information.

Does anybody know of any date formatting issues with Java on Apple?

This is the code I use to format dates:

DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.SHORT);
...
String dateLabel = this.dateFormat.format(someDate);

Sean and co. Do you do anything special to get your date formatting correct?

Cheers,
Kevin

  1. 1 Posted by Kevin Stembridg... on 18 Mar, 2012 10:54 PM

    Kevin Stembridge's Avatar

    To the Moneydance developers...

    Do you do anything special to ensure that dates are formatted correctly on Macs?

  2. Support Staff 2 Posted by Sean Reilly on 21 Mar, 2012 03:18 PM

    Sean Reilly's Avatar

    Hi Kevin,

    We use our own internal date formatter that observes the preference set by the customer. The default format is gotten from the system settings using the normal java way (the way that you are using):
    DateFormat.getDateInstance(DateFormat.SHORT)

    so I'm not sure why it would come out wrong for you and not moneydance itself. Maybe people want you to use the same date format that they've set in the moneydance preferences? If so, you can get your extensions context then cast it to com.moneydance.apps.md.controller.Main and call .getPreferences().getShortDateFormatter() to give you an instance of our custom date formatter which takes the integer dates from moneydance objects and is more lenient in parsing.

    Thanks,
    Sean

  3. 3 Posted by Kevin Stembridg... on 21 Mar, 2012 11:18 PM

    Kevin Stembridge's Avatar

    Hi Sean,
    Thanks for the reply. I'll try your suggestion and see if I can find a guinea pig to try it out for me.

    Thanks,
    Kevin

  4. System closed this discussion on 31 Mar, 2015 03:50 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac