Hi Guys,
I'm trying to implement the javascript for timezones:
Your timezone. The value is set automatically from your browser, so please only modify if it's incorrect. <br>
<b><a href="http://www.worldtimezone.com/" target="timezone">World Timezones</a></b>
<script language="JavaScript">
<!--
function setCustomerTimezone()
{
tzlist = document.getElementById("customfield_13423");
if (tzlist) {
if (/CreateIssueDetails.jspa/.test(tzlist.form.action)) {
// Value has not yet been set if (tzlist.value == -1) {
offset = new Date().getTimezoneOffset() / 60; // hours from GMT
if (offset <= 0) { tzlist.value="GMT+"+(-offset); }
else { tzlist.value = "GMT-"+offset; }
// }
}
}
}
window.onload = setCustomerTimezone;
//-->
</script>
But as stated on the Atlassian guide, it doesn't work beyond 4.3. This seems to be due to the new overlay create issue screen, which "CreateIssueDetails.jspa" obviously doesn't reference.
If I create an issue in the "http://jira-dev.site.com/secure/CreateIssue!default.jspa", this script will work (as was the method you created issues during 4.3.
Does anyone know how to get this working in 6.x? Even if it's a post-function? Atlassian seem to have gotten it working by removing the ability to have an overlay create screen, and effectively going back to a non-overlay method of creating an issue.
Many thanks!
You can review the previous solutions
Hi Tim,
I tried the following:
Your timezone. The value is set automatically from your browser, so please only modify if it's incorrect. <br>
<b><a href="http://www.worldtimezone.com/" target="timezone">World Timezones</a></b>
<script type="text/javascript">
<!--
jQuery(document).ready(function($) {
setCustomerTimezone();
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e,context) { setCustomerTimezone(); });
});
function setCustomerTimezone()
{
tzlist = document.getElementById("customfield_13423");
if (tzlist) {
if (/CreateIssueDetails.jspa/.test(tzlist.form.action)) {
// Value has not yet been set if (tzlist.value == -1) {
offset = new Date().getTimezoneOffset() / 60; // hours from GMT
if (offset <= 0) { tzlist.value="GMT+"+(-offset); }
else { tzlist.value = "GMT-"+offset; }
// }
}
}
}
window.onload = setCustomerTimezone;
//-->
</script>
Doesn't seem to work unfortunately, my javascripting is somewhat.....poop, so I could have gotten it wrong.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.