Created
September 10, 2013 16:48
-
-
Save abl/6512197 to your computer and use it in GitHub Desktop.
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
//This is completely ridiculous. | |
var jan = new Date(this.getFullYear(), 0, 1).getTimezoneOffset(); | |
var jul = new Date(this.getFullYear(), 6, 1).getTimezoneOffset(); | |
var today = new Date().getTimezoneOffset(); | |
if(jan == jul) { | |
$('#daylight_savings').prop('checked', false); | |
} else if(jan > jun) { | |
//Northern hemisphere | |
$('#daylight_savings').prop('checked', (jun==today)); | |
} else { //jun < jan | |
//Southern hemisphere | |
$('#daylight_savings').prop('checked', (jan==today)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment