forked from 0x2620/oxjs
Ox.load(), and adding moved files
This commit is contained in:
parent
dc1ec954fb
commit
6cfb6b7647
594 changed files with 1381 additions and 19555 deletions
49
source/js/Ox.UI/Form/Ox.DateTimeInput.js
Normal file
49
source/js/Ox.UI/Form/Ox.DateTimeInput.js
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
// vim: et:ts=4:sw=4:sts=4:ft=js
|
||||
Ox.DateTimeInput = function(options, self) {
|
||||
|
||||
var self = self || {},
|
||||
that = new Ox.Element({}, self)
|
||||
.defaults({
|
||||
ampm: false,
|
||||
format: 'short',
|
||||
seconds: false,
|
||||
value: Ox.formatDate(new Date(), '%F %T'),
|
||||
weekday: false
|
||||
})
|
||||
.options(options || {});
|
||||
|
||||
self.values = self.options.value.split(' ');
|
||||
//Ox.print(self.values)
|
||||
|
||||
that = new Ox.InputGroup({
|
||||
inputs: [
|
||||
new Ox.DateInput({
|
||||
format: self.options.format,
|
||||
id: 'date',
|
||||
value: self.values[0],
|
||||
weekday: self.options.weekday
|
||||
}),
|
||||
new Ox.TimeInput({
|
||||
ampm: self.options.ampm,
|
||||
id: 'time',
|
||||
value: self.values[1],
|
||||
seconds: self.options.seconds
|
||||
})
|
||||
],
|
||||
separators: [
|
||||
{title: '', width: 8}
|
||||
],
|
||||
value: self.options.value
|
||||
})
|
||||
.bindEvent('change', setValue);
|
||||
|
||||
function setValue() {
|
||||
self.options.value = [
|
||||
self.options('inputs')[0].options('value'),
|
||||
self.options('inputs')[1].options('value')
|
||||
].join(' ');
|
||||
}
|
||||
|
||||
return that;
|
||||
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue