Pyare
Pyare

Reputation: 681

How to change Date format for input type="date" in Jquery Mobile

I am developing android app using jquery mobile. i want to change default date format for input type = "date". how can do this?. one more thing from where the date picker is loading? anyone help ?

eg:- it is displaying date in following format by default: "mm/dd/yy". but i need to set this date format dynamically. How can i do this?

Upvotes: 2

Views: 1461

Answers (1)

Rachel Gallen
Rachel Gallen

Reputation: 28563

set

     input_type = TYPE_DATETIME_VARIATION_DATE

in your android.text field. this allows entering only a date.

you can parse it in your java script by doing this :

 DateFormat df = new SimpleDateFormat("EEE, dd MMM yyyy", Locale.getDefault());

Upvotes: 1

Related Questions