Date Formats

The date & time picker works with different date types:

  • JS date object - a common way of passing a date is through a Date object: new Date(1995, 11, 17, 15, 24) (make sure to not simply pass a date string to new Date())
  • ISO date string - standardized way of passing dates: '2008-09-15T15:53:00' (make sure to pass it as a string)
  • Moment.js object - a great solution that solves common date management difficulties: moment([2018, 3, 27, 12, 15]) (make sure to have moment.js loaded)

When passing dates to the component - eg. invalids, min/max - you can do it in either format and the picker will automatically know what to do with it. If you want to specify how the picker should return values, you can do it in the returnFormat option.

Download and try example

Demo

JS date object
$('#cal').mobiscroll().datepicker({
    returnFormat: 'jsdate'
});             
$('#cal').mobiscroll('setVal', new Date(2020, 10, 15, 10, 45));
$('#cal').mobiscroll('getVal'); // returns the selected date
ISO date string
$('#cal').mobiscroll().datepicker({
    returnFormat: 'iso8601'
});
$('#cal').mobiscroll('setVal', '2020-05-20T12:30:00'));
$('#cal').mobiscroll('getVal'); // returns the selected date
Moment.js object
$('#cal').mobiscroll().datepicker({
    returnFormat: 'moment'
});
$('#cal').mobiscroll('setVal', moment([2020, 2, 6, 15, 30]));
$('#cal').mobiscroll('getVal'); // returns the selected date

Duplicate Session

You have signed in on a different machine. To keep everything in sync, you have been signed out of this session.

If you need to invite team members, manage seats and accounts you can do it from the licenses page.

Duplicate Session

We noticed you are logged in on a different machine and have closed your old session.

If you need to invite team members, manage seats and accounts you can do it from the licenses page.