It looks like this (http://blog.pentalogic.net/2009/09/setting-default-duration-for-new-calender-events/) was written for SP2010. I used Firebug to inspect the labels for my time fields. They aren't actually "label" tags, they are "nobr" tags and do not have "for" attributes, so it appears that this solution is trying to access elements that SharePoint is no longer using.
I would just use the ID columns of the time boxes themselves, but they are some kind of generated code and and I'm worried that they won't always be the same. I have shown the generated code for the Start Time select box:
<select id="ctl00_ctl41_g_05eee1e1_a7d0_4b5e_9eb1_dc1e566ce47e_ctl00_ctl05_ctl00_ctl00_ctl00_ctl04_ctl00_ctl00_DateTimeField_DateTimeFieldDateHours" dir="ltr" name="ctl00$ctl41$g_05eee1e1_a7d0_4b5e_9eb1_dc1e566ce47e$ctl00$ctl05$ctl00$ctl00$ctl00$ctl04$ctl00$ctl00$DateTimeField$DateTimeFieldDateHours"> <option value="12 AM">12 AM</option> <option value="1 AM">1 AM</option> <option value="2 AM">2 AM</option> ... <option value="11 AM">11 AM</option> <option value="12 PM" selected="selected">12 PM</option> <option value="1 PM">1 PM</option> ... <option value="10 PM">10 PM</option> <option value="11 PM">11 PM</option> </select>
I need a way to set this that will always work and I suppose that if we know that the ID will always be the horrendously long string shown above, then I can just hard code that and get the element by its ID, but I don't know if it will be. Any advice?
Also, if it is important, I am using the modal window (and need to continue to do so).
EDIT: This question was flagged as a duplicate. In order to argue why this should not be the case, I would like to first point out, that the link I referenced above, is the same link as the answer to the question this one was claimed to be a duplicate of. Furthermore, I covered why I don't believe the solutions work. Yes, it is essentially the same goal, but the previous question was in the context of SharePoint 2010 and this one is in the context of SharePoint 2013 and I believe that makes them different because the answers for SharePoint 2010 don't appear to work for 2013. Also, the answers to the other question specifically exclude modal dialogues which are required in this question.