android - Localizing dates samsung galaxy -
i’m facing strange problem localizing dates. when running app on emulator swedish locale (sv) works fine. dates formatted according to: yyyy-mm-dd
however, when run same app on samsung galaxy s4 dates end as: dd-mm-yyyy
locale.getdefault().getlanguage() evaluates “sv” in both cases.
i use following snippet date string
public static string getdatestring(date date) { return android.text.format.dateformat.getdateformat(app.getcontext()).format(date); }
localization works fine when comes rest of ui.
any ideas?
it possible have different date format on 2 devices same locale set.
in android 4.x settings preferences on device allow users set date format not default date format locale selected on device.
the option available via; settings > date & time > choose date format
not option on samsung devices can found on stock android 4.x. on android 5.1 option seems have been removed.
Comments
Post a Comment