PageSourceSearch

https://events.middlesexcollege.edu/livewhale/scripts/lib/date/user.js

js middlesexcollege.edu collected 2026-10-01 15:25:56 UTC 697 bytes, 33 lines download raw bytes

1/*globals livewhale: true */
2
3if (typeof livewhale === 'undefined') {
4	window.livewhale = {};
5}
6if (!livewhale.lib) livewhale.lib = {};
7
8(function() {
9	var User = function(){
10		this._user_tz = null;
11	};
12
13	User.prototype = {
14		getTimezone: function() {
15			var dt, tz;
16
17			// get from browser
18			if (!this._user_tz) {
19				dt = new Date().toString();
20
21				// first regex works on majority of modern browsers, second works for IE
22				tz = dt.match(/\(([^\)]+)\)$/) || dt.match(/([A-Z]+) [\d]{4}$/);
23
24				this._user_tz = (tz) ? tz[1].match(/[A-Z]/g).join('') : 'EST';
25			}
26			return this._user_tz;
27		},
28		setTimezone: function(tz) {
29			this._user_tz = tz;
30		}
31	};
32	livewhale.lib.DateUser = User;
33}());

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.