How to have two different types of calendars on the same form?

132 Views Asked by At

I am interested in changing the calendar depending if the site is being browsed on a mobile or desktop.

This jQuery has both a calendar mode and an Android mode. http://dev.jtsage.com/jQM-DateBox/

How can I get it to change depending on the browser size?

Would I use something like this

document.documentElement.clientWidth
1

There are 1 best solutions below

0
On BEST ANSWER

It would be better to detect browser user_agent and display jquery calendar accordingly. Following is a code example:

if(navigator.userAgent.indexOf("Android") >= 0 || navigator.userAgent.indexOf("iPhone") >= 0) { 
// Show mobile calendar
} else {
// Show desktop calendar
}