can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[livejournal] r22266: LJSUP-12531: Repost: Error: Not able to ...

Committer: dpetrov
LJSUP-12531: Repost: Error: Not able to create new entry. Add tests to verify, that error is fixed.
U   trunk/htdocs/js/basic.js
Modified: trunk/htdocs/js/basic.js
===================================================================
--- trunk/htdocs/js/basic.js	2012-06-18 07:14:35 UTC (rev 22265)
+++ trunk/htdocs/js/basic.js	2012-06-18 08:35:33 UTC (rev 22266)
@@ -578,18 +578,20 @@
 	/**
 	 * Get timezone from the date object in the canonical way.
 	 *
-	 * @param {Date} date The date object.
 	 * @return {string} A string representation of timezone, eg +0400
 	 */
-	LJ.Util.Date.timezone = function(date) {
+	LJ.Util.Date.timezone = function() {
 		var offset = (-(new Date).getTimezoneOffset() / 0.6),
 			str = '';
 
 		if (offset > 0) {
 			str += '+';
+		} else if (offset < 0) {
+			str += '-';
+			offset = -offset;
 		}
 
-			str += ('' + offset).pad(4, '0');
+		str += ('' + offset).pad(4, '0');
 
 		return str;
 	}

Tags: can3p, dpetrov, js, livejournal
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments