date-ui-field ready, need tests

This commit is contained in:
vitalets
2013-01-05 00:02:40 +04:00
parent af9d11364e
commit 9b9bea9c54
7 changed files with 131 additions and 47 deletions

@ -155,13 +155,25 @@
var TypeConstructor, typeOptions, input,
type = options.type;
if(type === 'date' && options.mode === 'inline') {
if($.fn.editabletypes.datefield) {
type = 'datefield';
} else if($.fn.editabletypes.dateuifield) {
type = 'dateuifield';
}
}
//`date` is some kind of virtual type that is transformed to one of exact types
//depending on mode and core lib
if(type === 'date') {
//inline
if(options.mode === 'inline') {
if($.fn.editabletypes.datefield) {
type = 'datefield';
} else if($.fn.editabletypes.dateuifield) {
type = 'dateuifield';
}
//popup
} else {
if($.fn.editabletypes.date) {
type = 'date';
} else if($.fn.editabletypes.dateui) {
type = 'dateui';
}
}
}
//create input of specified type. Input will be used for converting value, not in form
if(typeof $.fn.editabletypes[type] === 'function') {