1
0
Fork 0
forked from 0x2620/oxjs

fix a corner case in Ox.formatDateRangeDuration()

This commit is contained in:
rlx 2011-10-10 17:00:01 +00:00
commit ccece375c0
4 changed files with 28 additions and 12 deletions

View file

@ -490,10 +490,14 @@ Ox.ListCalendar = function(options, self) {
index = Ox.getPositionById(self.options.events, id),
data = {id: id};
self.options.events[index][key] = value;
//Ox.print('EQUAL?', Ox.isEqual(self.$list.options('items'), self.options.events));
//alert(self.options.events[index][key] + '\n' + self.$list.options('items')[index][key]);
data[key] = value;
if (['start', 'end'].indexOf(key) > -1) {
self.$list.options({items: Ox.clone(self.options.events, true)});
if (['name', 'type', 'start', 'end'].indexOf(key) > -1) {
self.$calendar.editEvent(id, key, value);
}
if (key == 'name') {
self.$eventName.options({title: value});
} else if (['start', 'end'].indexOf(key) > -1) {
self.$durationInput.options({
value: Ox.formatDateRangeDuration(
self.$startInput.options('value'),
@ -503,10 +507,7 @@ Ox.ListCalendar = function(options, self) {
)
});
}
self.$list.options({items: Ox.clone(self.options.events, true)});
if (['name', 'type', 'start', 'end'].indexOf(key) > -1) {
self.$calendar.editEvent(id, key, value);
}
self.options.editEvent(data, function(result) {
// ...
});