Forums Register Login

JSpinner with dates

+Pie Number of slices to send: Send
I'm using a JSPinner that I'm defaulting to today with a max of today like this:

spnrMdl = new SpinnerDateModel(new Date(), null, new Date(),
Calendar.DAY_OF_MONTH);
spnr = new JSpinner(spnrMdl);

When I run this it shows the date in MM/DD/YY HH:mm PM format. When I click on the down spinner button, it highlights and decrements the month not the day. If I keep going to last year it does decrement the year too, so it knows what it's doing. I suspect this is related to the fact that I'm in Canada where we display our dates in DD/MM/YY format (which is how windows shows me it's dates).

1) How do I fix this?
2) How can I control the display format of the date in the JSpinner? I want this app to handle both US and Canadians!


thanks

ms
+Pie Number of slices to send: Send
Surfs up space ponies, I'm making gravy without this lumpy, tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 5778 times.
Similar Threads
I am not getting a sum for report in java
SQL server date format
data handling
data handling
JDBC SQL server date format problem
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 08:21:44.