Skip to content

Instantly share code, notes, and snippets.

@evanxd
Last active August 29, 2015 13:59
Show Gist options
  • Save evanxd/10842981 to your computer and use it in GitHub Desktop.
Save evanxd/10842981 to your computer and use it in GitHub Desktop.
Fill the startDate, startTime, endDate, and endTime inputs at modify event view in Calendar app.
[
{ selector: 'input[name="startDate"]', value: '2014-04-16' },
{ selector: 'input[name="startTime"]', value: '23:20' },
{ selector: 'input[name="endDate"]', value: '2014-04-17' },
{ selector: 'input[name="endTime"]', value: '01:20' }
].forEach(function(item) {
var hackElement = document.querySelector(item.selector);
hackElement.value = item.value;
hackElement.dispatchEvent(new Event('input', {
'view': window,
'bubbles': true,
'cancelable': true
}));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment