java - Return unknown characters in DateFormat as literals -


designing android app requires users able enter custom date format used display current time/date in exact user requested format dateformat.

i need users able mix literals (i.e. actual characters not parsed) characters using format date. understand can surround literals in ' (single quotes) desired behavior is: characters can formatted date part , other characters should return original character.

for example: if try format date string t hh:mm, error: unknown pattern character 't'. (as fallback return original string). desired behavior return formatted date unknown character e.g. t 11:03

how can achieve this?

to clarify: don't want rely on single-quotes 2 reasons:
1. want make simpler user enter date format and
2. want still work if user enters incorrect format

(as aside know when setting format textclock view behavior desired: unknown characters returned literally)


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -