Ticket #4950 (closed enhancement: wontfix)

SVN Diffs for #4950

 

Opened 3 years ago

RFE: DateFormat could use a method to return dates for current month, similar to getWeekdays() and getMonths()

Reported by: kbrown(at)us.ibm.com Assigned to: doug
Priority: assess Milestone: UNSCH
Component: unknown Version: 3.4
Keywords: returned Cc:
Load: Xref:
Java Version: sunjdk1.4.x Operating System: win32
Project (C/J): ICU4J Weeks:
Review:

Description

There are two reasons for doing this: one is to get an array or collection of dates that is correct for the currently selected month (e.g. array of numbers with a length of 28, 29 or 30, etc.) and the other is to properly resolve the type of numbers used in a particular calendar in a particular locale.

For example, a customer in Egypt has informed me that they use the Hindi numbers on their calendar there, not English or Arabic numbers. (Similarly, the Thai calendar uses Thai numbers, etc.) So currently I have to get the month names and weekday names from ICU's DateFormat, while I have to get all the numbers from our internal resource bundle in order to build a calendar GUI because ICU does not support this. I think it would be better to get all the relevant strings to build a calendar GUI from one place if possible. Thanks.

Attachments

Change History

12/31/69 18:20:26 changed by notes2

12/31/69 18:20:27 changed by auditor

  • Fri Dec 2 10:46:37 2005 grhoten sent reply 1
  • Fri Dec 2 10:47:14 2005 grhoten changed notes2: target: "UNSCH" to "", comments: "" to "This information can already be retrieved. See reply for details.",
  • Mon Dec 19 11:28:12 2005 weiv changed notes2: assign: "" to "doug", priority: "" to "assess",
  • Mon Dec 19 11:28:12 2005 weiv moved from incoming to formatting
  • Thu Nov 2 17:20:40 2006 emmons moved from formatting to returned

12/02/05 09:46:37 changed by George Rhoten <grhoten(at)gmail.com>

This information can already be retrieved from ((DecimalFormat)DateFormat.getNumberFormat()).getDecimalFormatSymbols().getZeroDigit()

Of course, you would want to make sure that the NumberFormat retrieved is a DecimalFormat by using Java's instanceof, or ICU4C's RTTI. It is always possible that the NumberFormat for a certain locale is a RuleBasedNumberFormat or some other formatter in the future, but at the moment it's always a DecimalFormat.

You can also set this information in a similar way to the get methods mentioned above.

A Hindi zero means that Hindi numbers are used. Likewise, a Thai zero means that Thai numbers are used.

BTW the dates written with a Thai calander doesn't always use Thai numbers in real world use in Thailand.


Add/Change #4950 (RFE: DateFormat could use a method to return dates for current month, similar to getWeekdays() and getMonths())




Anti spam check: