Android-Week-View icon indicating copy to clipboard operation
Android-Week-View copied to clipboard

Default dateTimeInterpreter should be based on current Locale.

Open MaciejCzekanski opened this issue 10 years ago • 5 comments

Currently date format is "EEEEE M/dd" which is different from one used eg. in Europe. I suggest replacing creating custom SimpleDateFormat with default one: DateFormat.getDateInstance(int style, Locale locale)

The same goes for time format.

MaciejCzekanski avatar Jan 15 '16 18:01 MaciejCzekanski

You can change the dateTimeInterpreter to your needs, no?

entropitor avatar Jan 15 '16 19:01 entropitor

Sure, but why not use default format which works for all countries?

MaciejCzekanski avatar Jan 16 '16 10:01 MaciejCzekanski

If you create a Pull Request, I can merge it.

Will it still use the "EEEE M/dd" format for Americans?

entropitor avatar Jan 18 '16 13:01 entropitor

Ok, from what I see, all styles in DateFormat.getDateInstance contain year, which we want to omit.

I could try using: int flags = DateUtils.FORMAT_ABBREV_WEEKDAY | DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_NO_YEAR; String monthAndDayText = DateUtils.formatDateTime(context, date, flags);

it should give us day and month formatted according to current user's locale.

I'll test it in coming days and create a pull request if it uses the same format for US.

MaciejCzekanski avatar Jan 18 '16 16:01 MaciejCzekanski

Okay :)

entropitor avatar Jan 19 '16 17:01 entropitor