- Timestamp:
- Jan 24, 2019 7:13:52 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/js/Utilities.js
r590 r654 65 65 $(this).text($(this).text().replace(' at ', '@').replace(' dot ', '.')); 66 66 if (this.href) { 67 this.href = this.href.replace(' at ', '@').replace(' dot ', '.');67 this.href = decodeURIComponent(this.href).replace(' at ', '@').replace(' dot ', '.'); 68 68 } 69 69 }); … … 100 100 }; 101 101 102 /* 103 * Set the user's timezone in a cookie (which is used in Codebase's $app->start() method). 104 --------------------------------------------------------------------- 105 Strangecode.setTimezoneCookie() 106 --------------------------------------------------------------------- 107 * @access public 108 * @version 1.0 109 * @since 24 Jan 2019 110 */ 111 Strangecode.setTimezoneCookie = function () { 112 try { 113 // use Intl API when available and returning valid time zone 114 var tz = Intl.DateTimeFormat().resolvedOptions().timeZone; 115 } catch (e) { 116 // Intl unavailable, fall back to manual guessing. 117 tz = (new Date().getTimezoneOffset()/-60); 118 } 119 if ('' != tz) { 120 document.cookie = 'tz=' + tz + ';path=/;max-age=86400'; 121 } 122 } 102 123 103 124 /*
Note: See TracChangeset
for help on using the changeset viewer.