Last active
August 29, 2015 13:59
-
-
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.
This file contains 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
[ | |
{ 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