Skip to content

Instantly share code, notes, and snippets.

@famanson
Last active September 23, 2015 13:56
Show Gist options
  • Save famanson/05f0fb572cbb39ea02da to your computer and use it in GitHub Desktop.
Save famanson/05f0fb572cbb39ea02da to your computer and use it in GitHub Desktop.
save: function() {
// Update the item
var dateString = this.get('dateString'),
hour = this.get('hour'),
minute = this.get('minute'),
period = this.get('period'),
timezone = this.get('timezone'),
item = this.get('item');
// Let's convert the hour back to 24-hour format...
if (period === 'am' && hour === 12) {
hour = 0;
} else if (period === 'pm') {
if (hour !== 12) {
hour += 12;
}
}
var self = this,
url = config.apiURL + 'app/item/edit',
data = {
item_id: item.blobId,
date: dateString,
hour: hour,
minute: minute,
timezone: timezone
};
return Ember.$.ajax({
url: url,
type: 'POST',
data: data
});
}
@sammy-SC
Copy link

what format should be the dateString?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment