Last active
September 23, 2015 13:56
-
-
Save famanson/05f0fb572cbb39ea02da to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
what format should be the dateString?