Jon Nylander avatar Jon Nylander committed 14425ed

Added support for -12 International Datetime west and +2 Mid Atlantic

Comments (0)

Files changed (1)

detect_timezone.js

  * The values of the dictionary are objects of either TimeZone or NonOlsenTimeZone.
  */
 olsen.timezones = {
-	'-720,0'   : new NonOlsenTimeZone('-12:00','International Datetime West', false),
+	'-720,0'   : new TimeZone('-12:00','Etc/GMT+12', false),
 	'-660,0'   : new TimeZone('-11:00','Pacific/Midway', false),
 	'-660,1,s' : new TimeZone('-11:00','Pacific/Apia', true),
 	'-600,0'   : new TimeZone('-10:00','Pacific/Honolulu', false),
 	'-180,0'   : new TimeZone('-03:00','America/Argentina/Buenos_Aires,', false),
 	'-180,1,s' : new TimeZone('-03:00','America/Montevideo', true),
 	'-120,0'   : new TimeZone('-02:00','America/Noronha', true),
-	'-120,1'   : new NonOlsenTimeZone('-02:00', 'Mid Atlantic', true),
+	'-120,1'   : new TimeZone('-02:00','Etc/GMT+2', true),
 	'-60,1'    : new TimeZone('-01:00','Atlantic/Azores', true),
 	'-60,0'    : new TimeZone('-01:00','Atlantic/Cape_Verde', false),
 	'0,0'      : new TimeZone('00:00','Atlantic/Reykjavik', false),
 }
 
 /**
- * Same as TimeZone but is used to signify that there really is no Olsen
- * database counterpart to this timezone. Usually you would have to live
- * on a non-moving boat to be able to live in these timezones.
- *
- * @constructor
- * @param {string} offset - for example '-11:00'
- * @param {string} tz_name - a name for the time zone
- * @param {boolean} uses_dst - flag for whether the time zone somehow cares about daylight savings.
- */
-function NonOlsenTimeZone(offset, tz_name, uses_dst) {
-	this.utc_offset = offset;
-	this.tz_name = tz_name;
-	this.uses_dst = uses_dst;
-}
-
-/**
- * Prints out information about the NonOlsenTimeZone.
- */
-NonOlsenTimeZone.prototype.display = function() {
-	var response_text = '<b style="color: red;">This timezone is not mapped in the Olsen database</b><br/>'
-	response_text += '<b>UTC-offset</b>: ' + this.utc_offset + '<br/>';
-	response_text += '<b>Time zone name</b>: ' + this.tz_name + '<br/>';
-	response_text += '<b>Daylight Savings</b>: ' + (this.uses_dst ? 'yes' : 'no') + '<br/>';
-	
-	return response_text;
-}
-
-/**
  * Checks whether a given date is in daylight savings time.
  * 
  * If the date supplied is after june, we assume that we're checking
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.