vitmalina/w2ui — pull request #765 by mpf82 (2014-12-19 10:10:04+00:00)
Title: Datetime field

Implementation of a datetime field with an optional "now" button to immediately set current date and time.

The "now" button is visible by default.

Moment.js is supported but is not required. When using moment.js the formatting for moment (field.format_mjs) has to be set.

All features of date field should be supported. (Limitation: colored days need to be formatted with w2utils.settings.date_format instead of the format used on field.format)

Enhancements: start, end and blocked days can also be Date object in addition to the the existing values (formated string, jquery object).

To make a field from the date and time examples (http://w2ui.com/web/docs/form/fields-date) behave like a datetime field, the following code snippet could be used:

```
type_date = 'datetime';
// for US format:
eu_format = 'm/d/yyyy|hh:mm';
eu_format_m = 'M/D/YYYY HH:mm';
eu_placeholder = eu_format_m.toLowerCase();
// for EU format:
eu_format = 'dd.mm.yyyy|hh24:mm:ss';
eu_format_m = 'DD.MM.YYYY HH:mm:ss';
eu_placeholder = eu_format_m.toLowerCase();

$('input[type=eu-date]' ).w2field(type_date, { format: eu_format, format_mjs: eu_format_m, placeholder: eu_placeholder });
```

The function isDateTime() still needs work, to validate the time part if moment.js is not used.