timezone_dropdown 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ae79bcd87a835f51ff720285677fb7ea16e61d5a
4
+ data.tar.gz: 9dc0caff17cb9ea5c69a5400cbe0f27614e23a37
5
+ SHA512:
6
+ metadata.gz: 4ce6d9ce53bf2761c27dc2edc8a9e41bb9440330fa3bcab734cb98a0ce05560030e5207feb3d75d767f24501a76917be84b35ca54e2495af30ef9691e77e245a
7
+ data.tar.gz: 5ee9eb481f096eb9130a1d23c25a05f94c777eef5c0545060b1ef1810079369c87fc0e05afd9177fed7116d8ca792faf792c0853b43a2045873aa0dc7d703c66
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.3.0
5
+ before_install: gem install bundler -v 1.12.5
@@ -0,0 +1,49 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, and in the interest of
4
+ fostering an open and welcoming community, we pledge to respect all people who
5
+ contribute through reporting issues, posting feature requests, updating
6
+ documentation, submitting pull requests or patches, and other activities.
7
+
8
+ We are committed to making participation in this project a harassment-free
9
+ experience for everyone, regardless of level of experience, gender, gender
10
+ identity and expression, sexual orientation, disability, personal appearance,
11
+ body size, race, ethnicity, age, religion, or nationality.
12
+
13
+ Examples of unacceptable behavior by participants include:
14
+
15
+ * The use of sexualized language or imagery
16
+ * Personal attacks
17
+ * Trolling or insulting/derogatory comments
18
+ * Public or private harassment
19
+ * Publishing other's private information, such as physical or electronic
20
+ addresses, without explicit permission
21
+ * Other unethical or unprofessional conduct
22
+
23
+ Project maintainers have the right and responsibility to remove, edit, or
24
+ reject comments, commits, code, wiki edits, issues, and other contributions
25
+ that are not aligned to this Code of Conduct, or to ban temporarily or
26
+ permanently any contributor for other behaviors that they deem inappropriate,
27
+ threatening, offensive, or harmful.
28
+
29
+ By adopting this Code of Conduct, project maintainers commit themselves to
30
+ fairly and consistently applying these principles to every aspect of managing
31
+ this project. Project maintainers who do not follow or enforce the Code of
32
+ Conduct may be permanently removed from the project team.
33
+
34
+ This code of conduct applies both within project spaces and in public spaces
35
+ when an individual is representing the project or its community.
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
38
+ reported by contacting a project maintainer at [shubham@rubyeffect.com]. All
39
+ complaints will be reviewed and investigated and will result in a response that
40
+ is deemed necessary and appropriate to the circumstances. Maintainers are
41
+ obligated to maintain confidentiality with regard to the reporter of an
42
+ incident.
43
+
44
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
45
+ version 1.3.0, available at
46
+ [http://contributor-covenant.org/version/1/3/0/][version]
47
+
48
+ [homepage]: http://contributor-covenant.org
49
+ [version]: http://contributor-covenant.org/version/1/3/0/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in timezone_dropdown.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 shubhs2050
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,78 @@
1
+ # TimezoneDropdown
2
+
3
+ Hi guys, this gem helps you to add a dropdown for timezone and change the timezone
4
+ according to needs of user
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ ```ruby
11
+ gem 'timezone_dropdown'
12
+ ```
13
+
14
+ And then execute:
15
+
16
+ $ bundle
17
+
18
+ Or install it yourself as:
19
+
20
+ $ gem install timezone_dropdown
21
+
22
+ ## Usage
23
+
24
+ Include timezone.js in your appplication.js
25
+
26
+ //= require timezone_dropdown
27
+
28
+ TODO: Add the below line where you want to add dropdown for time zone
29
+
30
+ ```view
31
+ <select class="form-control" id="timezone"></select>
32
+ ```
33
+
34
+ Add the below method in your controller with condition of your own for which you want the timezone to change.
35
+
36
+ ```
37
+ around_action :set_time_zone
38
+
39
+ private
40
+
41
+ def set_time_zone
42
+ Time.use_zone(current_user.timezone) { yield }
43
+ end
44
+ ```
45
+ For example you can use for a condition like this
46
+
47
+ ```
48
+ class ApplicationController < ActionController::Base
49
+ around_action :set_time_zone
50
+
51
+ def set_time_zone
52
+ if logged_in?
53
+ Time.use_zone(current_user.time_zone) { yield }
54
+ else
55
+ yield
56
+ end
57
+ end
58
+ end
59
+ ```
60
+
61
+
62
+ For any other Timezone related queries vist <a href="http://api.rubyonrails.org/classes/Time.html">here</a>
63
+
64
+ ## Development
65
+
66
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
67
+
68
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
69
+
70
+ ## Contributing
71
+
72
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/timezone_dropdown. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
73
+
74
+
75
+ ## License
76
+
77
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
78
+
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,8 @@
1
+ //
2
+ // testing
3
+ //
4
+ //= require jquery.timezones.full
5
+ $(document).ready(function(){
6
+ // test
7
+ $('select').timezones();
8
+ });
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "timezone_dropdown"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,7 @@
1
+ require "timezone_dropdown/version"
2
+
3
+ module TimezoneDropdown
4
+ class Engine < ::Rails::Engine
5
+ end
6
+ # Your code goes here...
7
+ end
@@ -0,0 +1,3 @@
1
+ module TimezoneDropdown
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,34 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'timezone_dropdown/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "timezone_dropdown"
8
+ spec.version = TimezoneDropdown::VERSION
9
+ spec.authors = ["shubhs2050"]
10
+ spec.email = ["[shubham@rubyeffect.com]"]
11
+
12
+ spec.summary = %q{askc}
13
+ spec.description = %q{This gem helps you to add a dropdown for timezone and change the timezone
14
+ according to needs of user}
15
+ spec.homepage = "https://github.com/shubhs2050/timezone_dropdown"
16
+ spec.license = "MIT"
17
+
18
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
19
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
20
+ # if spec.respond_to?(:metadata)
21
+ # spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
22
+ # else
23
+ # raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
24
+ # end
25
+
26
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
27
+ spec.bindir = "exe"
28
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
+ spec.require_paths = ["lib"]
30
+
31
+ spec.add_development_dependency "bundler", "~> 1.12"
32
+ spec.add_development_dependency "rake", "~> 10.0"
33
+ spec.add_development_dependency "rspec", "~> 3.0"
34
+ end
@@ -0,0 +1,3941 @@
1
+ /*!
2
+ * timezones - A jQuery plugin to turn a select box into a timezone selector
3
+ * v0.1.0
4
+ * https://github.com/firstandthird/timezones
5
+ * copyright First+Third 2014
6
+ * MIT License
7
+ */
8
+ //! moment.js
9
+ //! version : 2.8.3
10
+ //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
11
+ //! license : MIT
12
+ //! momentjs.com
13
+
14
+ (function (undefined) {
15
+ /************************************
16
+ Constants
17
+ ************************************/
18
+
19
+ var moment,
20
+ VERSION = '2.8.3',
21
+ // the global-scope this is NOT the global object in Node.js
22
+ globalScope = typeof global !== 'undefined' ? global : this,
23
+ oldGlobalMoment,
24
+ round = Math.round,
25
+ hasOwnProperty = Object.prototype.hasOwnProperty,
26
+ i,
27
+
28
+ YEAR = 0,
29
+ MONTH = 1,
30
+ DATE = 2,
31
+ HOUR = 3,
32
+ MINUTE = 4,
33
+ SECOND = 5,
34
+ MILLISECOND = 6,
35
+
36
+ // internal storage for locale config files
37
+ locales = {},
38
+
39
+ // extra moment internal properties (plugins register props here)
40
+ momentProperties = [],
41
+
42
+ // check for nodeJS
43
+ hasModule = (typeof module !== 'undefined' && module.exports),
44
+
45
+ // ASP.NET json date format regex
46
+ aspNetJsonRegex = /^\/?Date\((\-?\d+)/i,
47
+ aspNetTimeSpanJsonRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,
48
+
49
+ // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
50
+ // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
51
+ isoDurationRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,
52
+
53
+ // format tokens
54
+ formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|X|zz?|ZZ?|.)/g,
55
+ localFormattingTokens = /(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,
56
+
57
+ // parsing token regexes
58
+ parseTokenOneOrTwoDigits = /\d\d?/, // 0 - 99
59
+ parseTokenOneToThreeDigits = /\d{1,3}/, // 0 - 999
60
+ parseTokenOneToFourDigits = /\d{1,4}/, // 0 - 9999
61
+ parseTokenOneToSixDigits = /[+\-]?\d{1,6}/, // -999,999 - 999,999
62
+ parseTokenDigits = /\d+/, // nonzero number of digits
63
+ parseTokenWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i, // any word (or two) characters or numbers including two/three word month in arabic.
64
+ parseTokenTimezone = /Z|[\+\-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z
65
+ parseTokenT = /T/i, // T (ISO separator)
66
+ parseTokenTimestampMs = /[\+\-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123
67
+ parseTokenOrdinal = /\d{1,2}/,
68
+
69
+ //strict parsing regexes
70
+ parseTokenOneDigit = /\d/, // 0 - 9
71
+ parseTokenTwoDigits = /\d\d/, // 00 - 99
72
+ parseTokenThreeDigits = /\d{3}/, // 000 - 999
73
+ parseTokenFourDigits = /\d{4}/, // 0000 - 9999
74
+ parseTokenSixDigits = /[+-]?\d{6}/, // -999,999 - 999,999
75
+ parseTokenSignedNumber = /[+-]?\d+/, // -inf - inf
76
+
77
+ // iso 8601 regex
78
+ // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
79
+ isoRegex = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
80
+
81
+ isoFormat = 'YYYY-MM-DDTHH:mm:ssZ',
82
+
83
+ isoDates = [
84
+ ['YYYYYY-MM-DD', /[+-]\d{6}-\d{2}-\d{2}/],
85
+ ['YYYY-MM-DD', /\d{4}-\d{2}-\d{2}/],
86
+ ['GGGG-[W]WW-E', /\d{4}-W\d{2}-\d/],
87
+ ['GGGG-[W]WW', /\d{4}-W\d{2}/],
88
+ ['YYYY-DDD', /\d{4}-\d{3}/]
89
+ ],
90
+
91
+ // iso time formats and regexes
92
+ isoTimes = [
93
+ ['HH:mm:ss.SSSS', /(T| )\d\d:\d\d:\d\d\.\d+/],
94
+ ['HH:mm:ss', /(T| )\d\d:\d\d:\d\d/],
95
+ ['HH:mm', /(T| )\d\d:\d\d/],
96
+ ['HH', /(T| )\d\d/]
97
+ ],
98
+
99
+ // timezone chunker '+10:00' > ['10', '00'] or '-1530' > ['-15', '30']
100
+ parseTimezoneChunker = /([\+\-]|\d\d)/gi,
101
+
102
+ // getter and setter names
103
+ proxyGettersAndSetters = 'Date|Hours|Minutes|Seconds|Milliseconds'.split('|'),
104
+ unitMillisecondFactors = {
105
+ 'Milliseconds' : 1,
106
+ 'Seconds' : 1e3,
107
+ 'Minutes' : 6e4,
108
+ 'Hours' : 36e5,
109
+ 'Days' : 864e5,
110
+ 'Months' : 2592e6,
111
+ 'Years' : 31536e6
112
+ },
113
+
114
+ unitAliases = {
115
+ ms : 'millisecond',
116
+ s : 'second',
117
+ m : 'minute',
118
+ h : 'hour',
119
+ d : 'day',
120
+ D : 'date',
121
+ w : 'week',
122
+ W : 'isoWeek',
123
+ M : 'month',
124
+ Q : 'quarter',
125
+ y : 'year',
126
+ DDD : 'dayOfYear',
127
+ e : 'weekday',
128
+ E : 'isoWeekday',
129
+ gg: 'weekYear',
130
+ GG: 'isoWeekYear'
131
+ },
132
+
133
+ camelFunctions = {
134
+ dayofyear : 'dayOfYear',
135
+ isoweekday : 'isoWeekday',
136
+ isoweek : 'isoWeek',
137
+ weekyear : 'weekYear',
138
+ isoweekyear : 'isoWeekYear'
139
+ },
140
+
141
+ // format function strings
142
+ formatFunctions = {},
143
+
144
+ // default relative time thresholds
145
+ relativeTimeThresholds = {
146
+ s: 45, // seconds to minute
147
+ m: 45, // minutes to hour
148
+ h: 22, // hours to day
149
+ d: 26, // days to month
150
+ M: 11 // months to year
151
+ },
152
+
153
+ // tokens to ordinalize and pad
154
+ ordinalizeTokens = 'DDD w W M D d'.split(' '),
155
+ paddedTokens = 'M D H h m s w W'.split(' '),
156
+
157
+ formatTokenFunctions = {
158
+ M : function () {
159
+ return this.month() + 1;
160
+ },
161
+ MMM : function (format) {
162
+ return this.localeData().monthsShort(this, format);
163
+ },
164
+ MMMM : function (format) {
165
+ return this.localeData().months(this, format);
166
+ },
167
+ D : function () {
168
+ return this.date();
169
+ },
170
+ DDD : function () {
171
+ return this.dayOfYear();
172
+ },
173
+ d : function () {
174
+ return this.day();
175
+ },
176
+ dd : function (format) {
177
+ return this.localeData().weekdaysMin(this, format);
178
+ },
179
+ ddd : function (format) {
180
+ return this.localeData().weekdaysShort(this, format);
181
+ },
182
+ dddd : function (format) {
183
+ return this.localeData().weekdays(this, format);
184
+ },
185
+ w : function () {
186
+ return this.week();
187
+ },
188
+ W : function () {
189
+ return this.isoWeek();
190
+ },
191
+ YY : function () {
192
+ return leftZeroFill(this.year() % 100, 2);
193
+ },
194
+ YYYY : function () {
195
+ return leftZeroFill(this.year(), 4);
196
+ },
197
+ YYYYY : function () {
198
+ return leftZeroFill(this.year(), 5);
199
+ },
200
+ YYYYYY : function () {
201
+ var y = this.year(), sign = y >= 0 ? '+' : '-';
202
+ return sign + leftZeroFill(Math.abs(y), 6);
203
+ },
204
+ gg : function () {
205
+ return leftZeroFill(this.weekYear() % 100, 2);
206
+ },
207
+ gggg : function () {
208
+ return leftZeroFill(this.weekYear(), 4);
209
+ },
210
+ ggggg : function () {
211
+ return leftZeroFill(this.weekYear(), 5);
212
+ },
213
+ GG : function () {
214
+ return leftZeroFill(this.isoWeekYear() % 100, 2);
215
+ },
216
+ GGGG : function () {
217
+ return leftZeroFill(this.isoWeekYear(), 4);
218
+ },
219
+ GGGGG : function () {
220
+ return leftZeroFill(this.isoWeekYear(), 5);
221
+ },
222
+ e : function () {
223
+ return this.weekday();
224
+ },
225
+ E : function () {
226
+ return this.isoWeekday();
227
+ },
228
+ a : function () {
229
+ return this.localeData().meridiem(this.hours(), this.minutes(), true);
230
+ },
231
+ A : function () {
232
+ return this.localeData().meridiem(this.hours(), this.minutes(), false);
233
+ },
234
+ H : function () {
235
+ return this.hours();
236
+ },
237
+ h : function () {
238
+ return this.hours() % 12 || 12;
239
+ },
240
+ m : function () {
241
+ return this.minutes();
242
+ },
243
+ s : function () {
244
+ return this.seconds();
245
+ },
246
+ S : function () {
247
+ return toInt(this.milliseconds() / 100);
248
+ },
249
+ SS : function () {
250
+ return leftZeroFill(toInt(this.milliseconds() / 10), 2);
251
+ },
252
+ SSS : function () {
253
+ return leftZeroFill(this.milliseconds(), 3);
254
+ },
255
+ SSSS : function () {
256
+ return leftZeroFill(this.milliseconds(), 3);
257
+ },
258
+ Z : function () {
259
+ var a = -this.zone(),
260
+ b = '+';
261
+ if (a < 0) {
262
+ a = -a;
263
+ b = '-';
264
+ }
265
+ return b + leftZeroFill(toInt(a / 60), 2) + ':' + leftZeroFill(toInt(a) % 60, 2);
266
+ },
267
+ ZZ : function () {
268
+ var a = -this.zone(),
269
+ b = '+';
270
+ if (a < 0) {
271
+ a = -a;
272
+ b = '-';
273
+ }
274
+ return b + leftZeroFill(toInt(a / 60), 2) + leftZeroFill(toInt(a) % 60, 2);
275
+ },
276
+ z : function () {
277
+ return this.zoneAbbr();
278
+ },
279
+ zz : function () {
280
+ return this.zoneName();
281
+ },
282
+ X : function () {
283
+ return this.unix();
284
+ },
285
+ Q : function () {
286
+ return this.quarter();
287
+ }
288
+ },
289
+
290
+ deprecations = {},
291
+
292
+ lists = ['months', 'monthsShort', 'weekdays', 'weekdaysShort', 'weekdaysMin'];
293
+
294
+ // Pick the first defined of two or three arguments. dfl comes from
295
+ // default.
296
+ function dfl(a, b, c) {
297
+ switch (arguments.length) {
298
+ case 2: return a != null ? a : b;
299
+ case 3: return a != null ? a : b != null ? b : c;
300
+ default: throw new Error('Implement me');
301
+ }
302
+ }
303
+
304
+ function hasOwnProp(a, b) {
305
+ return hasOwnProperty.call(a, b);
306
+ }
307
+
308
+ function defaultParsingFlags() {
309
+ // We need to deep clone this object, and es5 standard is not very
310
+ // helpful.
311
+ return {
312
+ empty : false,
313
+ unusedTokens : [],
314
+ unusedInput : [],
315
+ overflow : -2,
316
+ charsLeftOver : 0,
317
+ nullInput : false,
318
+ invalidMonth : null,
319
+ invalidFormat : false,
320
+ userInvalidated : false,
321
+ iso: false
322
+ };
323
+ }
324
+
325
+ function printMsg(msg) {
326
+ if (moment.suppressDeprecationWarnings === false &&
327
+ typeof console !== 'undefined' && console.warn) {
328
+ console.warn('Deprecation warning: ' + msg);
329
+ }
330
+ }
331
+
332
+ function deprecate(msg, fn) {
333
+ var firstTime = true;
334
+ return extend(function () {
335
+ if (firstTime) {
336
+ printMsg(msg);
337
+ firstTime = false;
338
+ }
339
+ return fn.apply(this, arguments);
340
+ }, fn);
341
+ }
342
+
343
+ function deprecateSimple(name, msg) {
344
+ if (!deprecations[name]) {
345
+ printMsg(msg);
346
+ deprecations[name] = true;
347
+ }
348
+ }
349
+
350
+ function padToken(func, count) {
351
+ return function (a) {
352
+ return leftZeroFill(func.call(this, a), count);
353
+ };
354
+ }
355
+ function ordinalizeToken(func, period) {
356
+ return function (a) {
357
+ return this.localeData().ordinal(func.call(this, a), period);
358
+ };
359
+ }
360
+
361
+ while (ordinalizeTokens.length) {
362
+ i = ordinalizeTokens.pop();
363
+ formatTokenFunctions[i + 'o'] = ordinalizeToken(formatTokenFunctions[i], i);
364
+ }
365
+ while (paddedTokens.length) {
366
+ i = paddedTokens.pop();
367
+ formatTokenFunctions[i + i] = padToken(formatTokenFunctions[i], 2);
368
+ }
369
+ formatTokenFunctions.DDDD = padToken(formatTokenFunctions.DDD, 3);
370
+
371
+
372
+ /************************************
373
+ Constructors
374
+ ************************************/
375
+
376
+ function Locale() {
377
+ }
378
+
379
+ // Moment prototype object
380
+ function Moment(config, skipOverflow) {
381
+ if (skipOverflow !== false) {
382
+ checkOverflow(config);
383
+ }
384
+ copyConfig(this, config);
385
+ this._d = new Date(+config._d);
386
+ }
387
+
388
+ // Duration Constructor
389
+ function Duration(duration) {
390
+ var normalizedInput = normalizeObjectUnits(duration),
391
+ years = normalizedInput.year || 0,
392
+ quarters = normalizedInput.quarter || 0,
393
+ months = normalizedInput.month || 0,
394
+ weeks = normalizedInput.week || 0,
395
+ days = normalizedInput.day || 0,
396
+ hours = normalizedInput.hour || 0,
397
+ minutes = normalizedInput.minute || 0,
398
+ seconds = normalizedInput.second || 0,
399
+ milliseconds = normalizedInput.millisecond || 0;
400
+
401
+ // representation for dateAddRemove
402
+ this._milliseconds = +milliseconds +
403
+ seconds * 1e3 + // 1000
404
+ minutes * 6e4 + // 1000 * 60
405
+ hours * 36e5; // 1000 * 60 * 60
406
+ // Because of dateAddRemove treats 24 hours as different from a
407
+ // day when working around DST, we need to store them separately
408
+ this._days = +days +
409
+ weeks * 7;
410
+ // It is impossible translate months into days without knowing
411
+ // which months you are are talking about, so we have to store
412
+ // it separately.
413
+ this._months = +months +
414
+ quarters * 3 +
415
+ years * 12;
416
+
417
+ this._data = {};
418
+
419
+ this._locale = moment.localeData();
420
+
421
+ this._bubble();
422
+ }
423
+
424
+ /************************************
425
+ Helpers
426
+ ************************************/
427
+
428
+
429
+ function extend(a, b) {
430
+ for (var i in b) {
431
+ if (hasOwnProp(b, i)) {
432
+ a[i] = b[i];
433
+ }
434
+ }
435
+
436
+ if (hasOwnProp(b, 'toString')) {
437
+ a.toString = b.toString;
438
+ }
439
+
440
+ if (hasOwnProp(b, 'valueOf')) {
441
+ a.valueOf = b.valueOf;
442
+ }
443
+
444
+ return a;
445
+ }
446
+
447
+ function copyConfig(to, from) {
448
+ var i, prop, val;
449
+
450
+ if (typeof from._isAMomentObject !== 'undefined') {
451
+ to._isAMomentObject = from._isAMomentObject;
452
+ }
453
+ if (typeof from._i !== 'undefined') {
454
+ to._i = from._i;
455
+ }
456
+ if (typeof from._f !== 'undefined') {
457
+ to._f = from._f;
458
+ }
459
+ if (typeof from._l !== 'undefined') {
460
+ to._l = from._l;
461
+ }
462
+ if (typeof from._strict !== 'undefined') {
463
+ to._strict = from._strict;
464
+ }
465
+ if (typeof from._tzm !== 'undefined') {
466
+ to._tzm = from._tzm;
467
+ }
468
+ if (typeof from._isUTC !== 'undefined') {
469
+ to._isUTC = from._isUTC;
470
+ }
471
+ if (typeof from._offset !== 'undefined') {
472
+ to._offset = from._offset;
473
+ }
474
+ if (typeof from._pf !== 'undefined') {
475
+ to._pf = from._pf;
476
+ }
477
+ if (typeof from._locale !== 'undefined') {
478
+ to._locale = from._locale;
479
+ }
480
+
481
+ if (momentProperties.length > 0) {
482
+ for (i in momentProperties) {
483
+ prop = momentProperties[i];
484
+ val = from[prop];
485
+ if (typeof val !== 'undefined') {
486
+ to[prop] = val;
487
+ }
488
+ }
489
+ }
490
+
491
+ return to;
492
+ }
493
+
494
+ function absRound(number) {
495
+ if (number < 0) {
496
+ return Math.ceil(number);
497
+ } else {
498
+ return Math.floor(number);
499
+ }
500
+ }
501
+
502
+ // left zero fill a number
503
+ // see http://jsperf.com/left-zero-filling for performance comparison
504
+ function leftZeroFill(number, targetLength, forceSign) {
505
+ var output = '' + Math.abs(number),
506
+ sign = number >= 0;
507
+
508
+ while (output.length < targetLength) {
509
+ output = '0' + output;
510
+ }
511
+ return (sign ? (forceSign ? '+' : '') : '-') + output;
512
+ }
513
+
514
+ function positiveMomentsDifference(base, other) {
515
+ var res = {milliseconds: 0, months: 0};
516
+
517
+ res.months = other.month() - base.month() +
518
+ (other.year() - base.year()) * 12;
519
+ if (base.clone().add(res.months, 'M').isAfter(other)) {
520
+ --res.months;
521
+ }
522
+
523
+ res.milliseconds = +other - +(base.clone().add(res.months, 'M'));
524
+
525
+ return res;
526
+ }
527
+
528
+ function momentsDifference(base, other) {
529
+ var res;
530
+ other = makeAs(other, base);
531
+ if (base.isBefore(other)) {
532
+ res = positiveMomentsDifference(base, other);
533
+ } else {
534
+ res = positiveMomentsDifference(other, base);
535
+ res.milliseconds = -res.milliseconds;
536
+ res.months = -res.months;
537
+ }
538
+
539
+ return res;
540
+ }
541
+
542
+ // TODO: remove 'name' arg after deprecation is removed
543
+ function createAdder(direction, name) {
544
+ return function (val, period) {
545
+ var dur, tmp;
546
+ //invert the arguments, but complain about it
547
+ if (period !== null && !isNaN(+period)) {
548
+ deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period).');
549
+ tmp = val; val = period; period = tmp;
550
+ }
551
+
552
+ val = typeof val === 'string' ? +val : val;
553
+ dur = moment.duration(val, period);
554
+ addOrSubtractDurationFromMoment(this, dur, direction);
555
+ return this;
556
+ };
557
+ }
558
+
559
+ function addOrSubtractDurationFromMoment(mom, duration, isAdding, updateOffset) {
560
+ var milliseconds = duration._milliseconds,
561
+ days = duration._days,
562
+ months = duration._months;
563
+ updateOffset = updateOffset == null ? true : updateOffset;
564
+
565
+ if (milliseconds) {
566
+ mom._d.setTime(+mom._d + milliseconds * isAdding);
567
+ }
568
+ if (days) {
569
+ rawSetter(mom, 'Date', rawGetter(mom, 'Date') + days * isAdding);
570
+ }
571
+ if (months) {
572
+ rawMonthSetter(mom, rawGetter(mom, 'Month') + months * isAdding);
573
+ }
574
+ if (updateOffset) {
575
+ moment.updateOffset(mom, days || months);
576
+ }
577
+ }
578
+
579
+ // check if is an array
580
+ function isArray(input) {
581
+ return Object.prototype.toString.call(input) === '[object Array]';
582
+ }
583
+
584
+ function isDate(input) {
585
+ return Object.prototype.toString.call(input) === '[object Date]' ||
586
+ input instanceof Date;
587
+ }
588
+
589
+ // compare two arrays, return the number of differences
590
+ function compareArrays(array1, array2, dontConvert) {
591
+ var len = Math.min(array1.length, array2.length),
592
+ lengthDiff = Math.abs(array1.length - array2.length),
593
+ diffs = 0,
594
+ i;
595
+ for (i = 0; i < len; i++) {
596
+ if ((dontConvert && array1[i] !== array2[i]) ||
597
+ (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {
598
+ diffs++;
599
+ }
600
+ }
601
+ return diffs + lengthDiff;
602
+ }
603
+
604
+ function normalizeUnits(units) {
605
+ if (units) {
606
+ var lowered = units.toLowerCase().replace(/(.)s$/, '$1');
607
+ units = unitAliases[units] || camelFunctions[lowered] || lowered;
608
+ }
609
+ return units;
610
+ }
611
+
612
+ function normalizeObjectUnits(inputObject) {
613
+ var normalizedInput = {},
614
+ normalizedProp,
615
+ prop;
616
+
617
+ for (prop in inputObject) {
618
+ if (hasOwnProp(inputObject, prop)) {
619
+ normalizedProp = normalizeUnits(prop);
620
+ if (normalizedProp) {
621
+ normalizedInput[normalizedProp] = inputObject[prop];
622
+ }
623
+ }
624
+ }
625
+
626
+ return normalizedInput;
627
+ }
628
+
629
+ function makeList(field) {
630
+ var count, setter;
631
+
632
+ if (field.indexOf('week') === 0) {
633
+ count = 7;
634
+ setter = 'day';
635
+ }
636
+ else if (field.indexOf('month') === 0) {
637
+ count = 12;
638
+ setter = 'month';
639
+ }
640
+ else {
641
+ return;
642
+ }
643
+
644
+ moment[field] = function (format, index) {
645
+ var i, getter,
646
+ method = moment._locale[field],
647
+ results = [];
648
+
649
+ if (typeof format === 'number') {
650
+ index = format;
651
+ format = undefined;
652
+ }
653
+
654
+ getter = function (i) {
655
+ var m = moment().utc().set(setter, i);
656
+ return method.call(moment._locale, m, format || '');
657
+ };
658
+
659
+ if (index != null) {
660
+ return getter(index);
661
+ }
662
+ else {
663
+ for (i = 0; i < count; i++) {
664
+ results.push(getter(i));
665
+ }
666
+ return results;
667
+ }
668
+ };
669
+ }
670
+
671
+ function toInt(argumentForCoercion) {
672
+ var coercedNumber = +argumentForCoercion,
673
+ value = 0;
674
+
675
+ if (coercedNumber !== 0 && isFinite(coercedNumber)) {
676
+ if (coercedNumber >= 0) {
677
+ value = Math.floor(coercedNumber);
678
+ } else {
679
+ value = Math.ceil(coercedNumber);
680
+ }
681
+ }
682
+
683
+ return value;
684
+ }
685
+
686
+ function daysInMonth(year, month) {
687
+ return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();
688
+ }
689
+
690
+ function weeksInYear(year, dow, doy) {
691
+ return weekOfYear(moment([year, 11, 31 + dow - doy]), dow, doy).week;
692
+ }
693
+
694
+ function daysInYear(year) {
695
+ return isLeapYear(year) ? 366 : 365;
696
+ }
697
+
698
+ function isLeapYear(year) {
699
+ return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
700
+ }
701
+
702
+ function checkOverflow(m) {
703
+ var overflow;
704
+ if (m._a && m._pf.overflow === -2) {
705
+ overflow =
706
+ m._a[MONTH] < 0 || m._a[MONTH] > 11 ? MONTH :
707
+ m._a[DATE] < 1 || m._a[DATE] > daysInMonth(m._a[YEAR], m._a[MONTH]) ? DATE :
708
+ m._a[HOUR] < 0 || m._a[HOUR] > 23 ? HOUR :
709
+ m._a[MINUTE] < 0 || m._a[MINUTE] > 59 ? MINUTE :
710
+ m._a[SECOND] < 0 || m._a[SECOND] > 59 ? SECOND :
711
+ m._a[MILLISECOND] < 0 || m._a[MILLISECOND] > 999 ? MILLISECOND :
712
+ -1;
713
+
714
+ if (m._pf._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
715
+ overflow = DATE;
716
+ }
717
+
718
+ m._pf.overflow = overflow;
719
+ }
720
+ }
721
+
722
+ function isValid(m) {
723
+ if (m._isValid == null) {
724
+ m._isValid = !isNaN(m._d.getTime()) &&
725
+ m._pf.overflow < 0 &&
726
+ !m._pf.empty &&
727
+ !m._pf.invalidMonth &&
728
+ !m._pf.nullInput &&
729
+ !m._pf.invalidFormat &&
730
+ !m._pf.userInvalidated;
731
+
732
+ if (m._strict) {
733
+ m._isValid = m._isValid &&
734
+ m._pf.charsLeftOver === 0 &&
735
+ m._pf.unusedTokens.length === 0;
736
+ }
737
+ }
738
+ return m._isValid;
739
+ }
740
+
741
+ function normalizeLocale(key) {
742
+ return key ? key.toLowerCase().replace('_', '-') : key;
743
+ }
744
+
745
+ // pick the locale from the array
746
+ // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
747
+ // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
748
+ function chooseLocale(names) {
749
+ var i = 0, j, next, locale, split;
750
+
751
+ while (i < names.length) {
752
+ split = normalizeLocale(names[i]).split('-');
753
+ j = split.length;
754
+ next = normalizeLocale(names[i + 1]);
755
+ next = next ? next.split('-') : null;
756
+ while (j > 0) {
757
+ locale = loadLocale(split.slice(0, j).join('-'));
758
+ if (locale) {
759
+ return locale;
760
+ }
761
+ if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
762
+ //the next array item is better than a shallower substring of this one
763
+ break;
764
+ }
765
+ j--;
766
+ }
767
+ i++;
768
+ }
769
+ return null;
770
+ }
771
+
772
+ function loadLocale(name) {
773
+ var oldLocale = null;
774
+ if (!locales[name] && hasModule) {
775
+ try {
776
+ oldLocale = moment.locale();
777
+ require('./locale/' + name);
778
+ // because defineLocale currently also sets the global locale, we want to undo that for lazy loaded locales
779
+ moment.locale(oldLocale);
780
+ } catch (e) { }
781
+ }
782
+ return locales[name];
783
+ }
784
+
785
+ // Return a moment from input, that is local/utc/zone equivalent to model.
786
+ function makeAs(input, model) {
787
+ return model._isUTC ? moment(input).zone(model._offset || 0) :
788
+ moment(input).local();
789
+ }
790
+
791
+ /************************************
792
+ Locale
793
+ ************************************/
794
+
795
+
796
+ extend(Locale.prototype, {
797
+
798
+ set : function (config) {
799
+ var prop, i;
800
+ for (i in config) {
801
+ prop = config[i];
802
+ if (typeof prop === 'function') {
803
+ this[i] = prop;
804
+ } else {
805
+ this['_' + i] = prop;
806
+ }
807
+ }
808
+ },
809
+
810
+ _months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
811
+ months : function (m) {
812
+ return this._months[m.month()];
813
+ },
814
+
815
+ _monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
816
+ monthsShort : function (m) {
817
+ return this._monthsShort[m.month()];
818
+ },
819
+
820
+ monthsParse : function (monthName) {
821
+ var i, mom, regex;
822
+
823
+ if (!this._monthsParse) {
824
+ this._monthsParse = [];
825
+ }
826
+
827
+ for (i = 0; i < 12; i++) {
828
+ // make the regex if we don't have it already
829
+ if (!this._monthsParse[i]) {
830
+ mom = moment.utc([2000, i]);
831
+ regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
832
+ this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
833
+ }
834
+ // test the regex
835
+ if (this._monthsParse[i].test(monthName)) {
836
+ return i;
837
+ }
838
+ }
839
+ },
840
+
841
+ _weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
842
+ weekdays : function (m) {
843
+ return this._weekdays[m.day()];
844
+ },
845
+
846
+ _weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
847
+ weekdaysShort : function (m) {
848
+ return this._weekdaysShort[m.day()];
849
+ },
850
+
851
+ _weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
852
+ weekdaysMin : function (m) {
853
+ return this._weekdaysMin[m.day()];
854
+ },
855
+
856
+ weekdaysParse : function (weekdayName) {
857
+ var i, mom, regex;
858
+
859
+ if (!this._weekdaysParse) {
860
+ this._weekdaysParse = [];
861
+ }
862
+
863
+ for (i = 0; i < 7; i++) {
864
+ // make the regex if we don't have it already
865
+ if (!this._weekdaysParse[i]) {
866
+ mom = moment([2000, 1]).day(i);
867
+ regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
868
+ this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
869
+ }
870
+ // test the regex
871
+ if (this._weekdaysParse[i].test(weekdayName)) {
872
+ return i;
873
+ }
874
+ }
875
+ },
876
+
877
+ _longDateFormat : {
878
+ LT : 'h:mm A',
879
+ L : 'MM/DD/YYYY',
880
+ LL : 'MMMM D, YYYY',
881
+ LLL : 'MMMM D, YYYY LT',
882
+ LLLL : 'dddd, MMMM D, YYYY LT'
883
+ },
884
+ longDateFormat : function (key) {
885
+ var output = this._longDateFormat[key];
886
+ if (!output && this._longDateFormat[key.toUpperCase()]) {
887
+ output = this._longDateFormat[key.toUpperCase()].replace(/MMMM|MM|DD|dddd/g, function (val) {
888
+ return val.slice(1);
889
+ });
890
+ this._longDateFormat[key] = output;
891
+ }
892
+ return output;
893
+ },
894
+
895
+ isPM : function (input) {
896
+ // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
897
+ // Using charAt should be more compatible.
898
+ return ((input + '').toLowerCase().charAt(0) === 'p');
899
+ },
900
+
901
+ _meridiemParse : /[ap]\.?m?\.?/i,
902
+ meridiem : function (hours, minutes, isLower) {
903
+ if (hours > 11) {
904
+ return isLower ? 'pm' : 'PM';
905
+ } else {
906
+ return isLower ? 'am' : 'AM';
907
+ }
908
+ },
909
+
910
+ _calendar : {
911
+ sameDay : '[Today at] LT',
912
+ nextDay : '[Tomorrow at] LT',
913
+ nextWeek : 'dddd [at] LT',
914
+ lastDay : '[Yesterday at] LT',
915
+ lastWeek : '[Last] dddd [at] LT',
916
+ sameElse : 'L'
917
+ },
918
+ calendar : function (key, mom) {
919
+ var output = this._calendar[key];
920
+ return typeof output === 'function' ? output.apply(mom) : output;
921
+ },
922
+
923
+ _relativeTime : {
924
+ future : 'in %s',
925
+ past : '%s ago',
926
+ s : 'a few seconds',
927
+ m : 'a minute',
928
+ mm : '%d minutes',
929
+ h : 'an hour',
930
+ hh : '%d hours',
931
+ d : 'a day',
932
+ dd : '%d days',
933
+ M : 'a month',
934
+ MM : '%d months',
935
+ y : 'a year',
936
+ yy : '%d years'
937
+ },
938
+
939
+ relativeTime : function (number, withoutSuffix, string, isFuture) {
940
+ var output = this._relativeTime[string];
941
+ return (typeof output === 'function') ?
942
+ output(number, withoutSuffix, string, isFuture) :
943
+ output.replace(/%d/i, number);
944
+ },
945
+
946
+ pastFuture : function (diff, output) {
947
+ var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
948
+ return typeof format === 'function' ? format(output) : format.replace(/%s/i, output);
949
+ },
950
+
951
+ ordinal : function (number) {
952
+ return this._ordinal.replace('%d', number);
953
+ },
954
+ _ordinal : '%d',
955
+
956
+ preparse : function (string) {
957
+ return string;
958
+ },
959
+
960
+ postformat : function (string) {
961
+ return string;
962
+ },
963
+
964
+ week : function (mom) {
965
+ return weekOfYear(mom, this._week.dow, this._week.doy).week;
966
+ },
967
+
968
+ _week : {
969
+ dow : 0, // Sunday is the first day of the week.
970
+ doy : 6 // The week that contains Jan 1st is the first week of the year.
971
+ },
972
+
973
+ _invalidDate: 'Invalid date',
974
+ invalidDate: function () {
975
+ return this._invalidDate;
976
+ }
977
+ });
978
+
979
+ /************************************
980
+ Formatting
981
+ ************************************/
982
+
983
+
984
+ function removeFormattingTokens(input) {
985
+ if (input.match(/\[[\s\S]/)) {
986
+ return input.replace(/^\[|\]$/g, '');
987
+ }
988
+ return input.replace(/\\/g, '');
989
+ }
990
+
991
+ function makeFormatFunction(format) {
992
+ var array = format.match(formattingTokens), i, length;
993
+
994
+ for (i = 0, length = array.length; i < length; i++) {
995
+ if (formatTokenFunctions[array[i]]) {
996
+ array[i] = formatTokenFunctions[array[i]];
997
+ } else {
998
+ array[i] = removeFormattingTokens(array[i]);
999
+ }
1000
+ }
1001
+
1002
+ return function (mom) {
1003
+ var output = '';
1004
+ for (i = 0; i < length; i++) {
1005
+ output += array[i] instanceof Function ? array[i].call(mom, format) : array[i];
1006
+ }
1007
+ return output;
1008
+ };
1009
+ }
1010
+
1011
+ // format date using native date object
1012
+ function formatMoment(m, format) {
1013
+ if (!m.isValid()) {
1014
+ return m.localeData().invalidDate();
1015
+ }
1016
+
1017
+ format = expandFormat(format, m.localeData());
1018
+
1019
+ if (!formatFunctions[format]) {
1020
+ formatFunctions[format] = makeFormatFunction(format);
1021
+ }
1022
+
1023
+ return formatFunctions[format](m);
1024
+ }
1025
+
1026
+ function expandFormat(format, locale) {
1027
+ var i = 5;
1028
+
1029
+ function replaceLongDateFormatTokens(input) {
1030
+ return locale.longDateFormat(input) || input;
1031
+ }
1032
+
1033
+ localFormattingTokens.lastIndex = 0;
1034
+ while (i >= 0 && localFormattingTokens.test(format)) {
1035
+ format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
1036
+ localFormattingTokens.lastIndex = 0;
1037
+ i -= 1;
1038
+ }
1039
+
1040
+ return format;
1041
+ }
1042
+
1043
+
1044
+ /************************************
1045
+ Parsing
1046
+ ************************************/
1047
+
1048
+
1049
+ // get the regex to find the next token
1050
+ function getParseRegexForToken(token, config) {
1051
+ var a, strict = config._strict;
1052
+ switch (token) {
1053
+ case 'Q':
1054
+ return parseTokenOneDigit;
1055
+ case 'DDDD':
1056
+ return parseTokenThreeDigits;
1057
+ case 'YYYY':
1058
+ case 'GGGG':
1059
+ case 'gggg':
1060
+ return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;
1061
+ case 'Y':
1062
+ case 'G':
1063
+ case 'g':
1064
+ return parseTokenSignedNumber;
1065
+ case 'YYYYYY':
1066
+ case 'YYYYY':
1067
+ case 'GGGGG':
1068
+ case 'ggggg':
1069
+ return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;
1070
+ case 'S':
1071
+ if (strict) {
1072
+ return parseTokenOneDigit;
1073
+ }
1074
+ /* falls through */
1075
+ case 'SS':
1076
+ if (strict) {
1077
+ return parseTokenTwoDigits;
1078
+ }
1079
+ /* falls through */
1080
+ case 'SSS':
1081
+ if (strict) {
1082
+ return parseTokenThreeDigits;
1083
+ }
1084
+ /* falls through */
1085
+ case 'DDD':
1086
+ return parseTokenOneToThreeDigits;
1087
+ case 'MMM':
1088
+ case 'MMMM':
1089
+ case 'dd':
1090
+ case 'ddd':
1091
+ case 'dddd':
1092
+ return parseTokenWord;
1093
+ case 'a':
1094
+ case 'A':
1095
+ return config._locale._meridiemParse;
1096
+ case 'X':
1097
+ return parseTokenTimestampMs;
1098
+ case 'Z':
1099
+ case 'ZZ':
1100
+ return parseTokenTimezone;
1101
+ case 'T':
1102
+ return parseTokenT;
1103
+ case 'SSSS':
1104
+ return parseTokenDigits;
1105
+ case 'MM':
1106
+ case 'DD':
1107
+ case 'YY':
1108
+ case 'GG':
1109
+ case 'gg':
1110
+ case 'HH':
1111
+ case 'hh':
1112
+ case 'mm':
1113
+ case 'ss':
1114
+ case 'ww':
1115
+ case 'WW':
1116
+ return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;
1117
+ case 'M':
1118
+ case 'D':
1119
+ case 'd':
1120
+ case 'H':
1121
+ case 'h':
1122
+ case 'm':
1123
+ case 's':
1124
+ case 'w':
1125
+ case 'W':
1126
+ case 'e':
1127
+ case 'E':
1128
+ return parseTokenOneOrTwoDigits;
1129
+ case 'Do':
1130
+ return parseTokenOrdinal;
1131
+ default :
1132
+ a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\', '')), 'i'));
1133
+ return a;
1134
+ }
1135
+ }
1136
+
1137
+ function timezoneMinutesFromString(string) {
1138
+ string = string || '';
1139
+ var possibleTzMatches = (string.match(parseTokenTimezone) || []),
1140
+ tzChunk = possibleTzMatches[possibleTzMatches.length - 1] || [],
1141
+ parts = (tzChunk + '').match(parseTimezoneChunker) || ['-', 0, 0],
1142
+ minutes = +(parts[1] * 60) + toInt(parts[2]);
1143
+
1144
+ return parts[0] === '+' ? -minutes : minutes;
1145
+ }
1146
+
1147
+ // function to convert string input to date
1148
+ function addTimeToArrayFromToken(token, input, config) {
1149
+ var a, datePartArray = config._a;
1150
+
1151
+ switch (token) {
1152
+ // QUARTER
1153
+ case 'Q':
1154
+ if (input != null) {
1155
+ datePartArray[MONTH] = (toInt(input) - 1) * 3;
1156
+ }
1157
+ break;
1158
+ // MONTH
1159
+ case 'M' : // fall through to MM
1160
+ case 'MM' :
1161
+ if (input != null) {
1162
+ datePartArray[MONTH] = toInt(input) - 1;
1163
+ }
1164
+ break;
1165
+ case 'MMM' : // fall through to MMMM
1166
+ case 'MMMM' :
1167
+ a = config._locale.monthsParse(input);
1168
+ // if we didn't find a month name, mark the date as invalid.
1169
+ if (a != null) {
1170
+ datePartArray[MONTH] = a;
1171
+ } else {
1172
+ config._pf.invalidMonth = input;
1173
+ }
1174
+ break;
1175
+ // DAY OF MONTH
1176
+ case 'D' : // fall through to DD
1177
+ case 'DD' :
1178
+ if (input != null) {
1179
+ datePartArray[DATE] = toInt(input);
1180
+ }
1181
+ break;
1182
+ case 'Do' :
1183
+ if (input != null) {
1184
+ datePartArray[DATE] = toInt(parseInt(input, 10));
1185
+ }
1186
+ break;
1187
+ // DAY OF YEAR
1188
+ case 'DDD' : // fall through to DDDD
1189
+ case 'DDDD' :
1190
+ if (input != null) {
1191
+ config._dayOfYear = toInt(input);
1192
+ }
1193
+
1194
+ break;
1195
+ // YEAR
1196
+ case 'YY' :
1197
+ datePartArray[YEAR] = moment.parseTwoDigitYear(input);
1198
+ break;
1199
+ case 'YYYY' :
1200
+ case 'YYYYY' :
1201
+ case 'YYYYYY' :
1202
+ datePartArray[YEAR] = toInt(input);
1203
+ break;
1204
+ // AM / PM
1205
+ case 'a' : // fall through to A
1206
+ case 'A' :
1207
+ config._isPm = config._locale.isPM(input);
1208
+ break;
1209
+ // 24 HOUR
1210
+ case 'H' : // fall through to hh
1211
+ case 'HH' : // fall through to hh
1212
+ case 'h' : // fall through to hh
1213
+ case 'hh' :
1214
+ datePartArray[HOUR] = toInt(input);
1215
+ break;
1216
+ // MINUTE
1217
+ case 'm' : // fall through to mm
1218
+ case 'mm' :
1219
+ datePartArray[MINUTE] = toInt(input);
1220
+ break;
1221
+ // SECOND
1222
+ case 's' : // fall through to ss
1223
+ case 'ss' :
1224
+ datePartArray[SECOND] = toInt(input);
1225
+ break;
1226
+ // MILLISECOND
1227
+ case 'S' :
1228
+ case 'SS' :
1229
+ case 'SSS' :
1230
+ case 'SSSS' :
1231
+ datePartArray[MILLISECOND] = toInt(('0.' + input) * 1000);
1232
+ break;
1233
+ // UNIX TIMESTAMP WITH MS
1234
+ case 'X':
1235
+ config._d = new Date(parseFloat(input) * 1000);
1236
+ break;
1237
+ // TIMEZONE
1238
+ case 'Z' : // fall through to ZZ
1239
+ case 'ZZ' :
1240
+ config._useUTC = true;
1241
+ config._tzm = timezoneMinutesFromString(input);
1242
+ break;
1243
+ // WEEKDAY - human
1244
+ case 'dd':
1245
+ case 'ddd':
1246
+ case 'dddd':
1247
+ a = config._locale.weekdaysParse(input);
1248
+ // if we didn't get a weekday name, mark the date as invalid
1249
+ if (a != null) {
1250
+ config._w = config._w || {};
1251
+ config._w['d'] = a;
1252
+ } else {
1253
+ config._pf.invalidWeekday = input;
1254
+ }
1255
+ break;
1256
+ // WEEK, WEEK DAY - numeric
1257
+ case 'w':
1258
+ case 'ww':
1259
+ case 'W':
1260
+ case 'WW':
1261
+ case 'd':
1262
+ case 'e':
1263
+ case 'E':
1264
+ token = token.substr(0, 1);
1265
+ /* falls through */
1266
+ case 'gggg':
1267
+ case 'GGGG':
1268
+ case 'GGGGG':
1269
+ token = token.substr(0, 2);
1270
+ if (input) {
1271
+ config._w = config._w || {};
1272
+ config._w[token] = toInt(input);
1273
+ }
1274
+ break;
1275
+ case 'gg':
1276
+ case 'GG':
1277
+ config._w = config._w || {};
1278
+ config._w[token] = moment.parseTwoDigitYear(input);
1279
+ }
1280
+ }
1281
+
1282
+ function dayOfYearFromWeekInfo(config) {
1283
+ var w, weekYear, week, weekday, dow, doy, temp;
1284
+
1285
+ w = config._w;
1286
+ if (w.GG != null || w.W != null || w.E != null) {
1287
+ dow = 1;
1288
+ doy = 4;
1289
+
1290
+ // TODO: We need to take the current isoWeekYear, but that depends on
1291
+ // how we interpret now (local, utc, fixed offset). So create
1292
+ // a now version of current config (take local/utc/offset flags, and
1293
+ // create now).
1294
+ weekYear = dfl(w.GG, config._a[YEAR], weekOfYear(moment(), 1, 4).year);
1295
+ week = dfl(w.W, 1);
1296
+ weekday = dfl(w.E, 1);
1297
+ } else {
1298
+ dow = config._locale._week.dow;
1299
+ doy = config._locale._week.doy;
1300
+
1301
+ weekYear = dfl(w.gg, config._a[YEAR], weekOfYear(moment(), dow, doy).year);
1302
+ week = dfl(w.w, 1);
1303
+
1304
+ if (w.d != null) {
1305
+ // weekday -- low day numbers are considered next week
1306
+ weekday = w.d;
1307
+ if (weekday < dow) {
1308
+ ++week;
1309
+ }
1310
+ } else if (w.e != null) {
1311
+ // local weekday -- counting starts from begining of week
1312
+ weekday = w.e + dow;
1313
+ } else {
1314
+ // default to begining of week
1315
+ weekday = dow;
1316
+ }
1317
+ }
1318
+ temp = dayOfYearFromWeeks(weekYear, week, weekday, doy, dow);
1319
+
1320
+ config._a[YEAR] = temp.year;
1321
+ config._dayOfYear = temp.dayOfYear;
1322
+ }
1323
+
1324
+ // convert an array to a date.
1325
+ // the array should mirror the parameters below
1326
+ // note: all values past the year are optional and will default to the lowest possible value.
1327
+ // [year, month, day , hour, minute, second, millisecond]
1328
+ function dateFromConfig(config) {
1329
+ var i, date, input = [], currentDate, yearToUse;
1330
+
1331
+ if (config._d) {
1332
+ return;
1333
+ }
1334
+
1335
+ currentDate = currentDateArray(config);
1336
+
1337
+ //compute day of the year from weeks and weekdays
1338
+ if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
1339
+ dayOfYearFromWeekInfo(config);
1340
+ }
1341
+
1342
+ //if the day of the year is set, figure out what it is
1343
+ if (config._dayOfYear) {
1344
+ yearToUse = dfl(config._a[YEAR], currentDate[YEAR]);
1345
+
1346
+ if (config._dayOfYear > daysInYear(yearToUse)) {
1347
+ config._pf._overflowDayOfYear = true;
1348
+ }
1349
+
1350
+ date = makeUTCDate(yearToUse, 0, config._dayOfYear);
1351
+ config._a[MONTH] = date.getUTCMonth();
1352
+ config._a[DATE] = date.getUTCDate();
1353
+ }
1354
+
1355
+ // Default to current date.
1356
+ // * if no year, month, day of month are given, default to today
1357
+ // * if day of month is given, default month and year
1358
+ // * if month is given, default only year
1359
+ // * if year is given, don't default anything
1360
+ for (i = 0; i < 3 && config._a[i] == null; ++i) {
1361
+ config._a[i] = input[i] = currentDate[i];
1362
+ }
1363
+
1364
+ // Zero out whatever was not defaulted, including time
1365
+ for (; i < 7; i++) {
1366
+ config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
1367
+ }
1368
+
1369
+ config._d = (config._useUTC ? makeUTCDate : makeDate).apply(null, input);
1370
+ // Apply timezone offset from input. The actual zone can be changed
1371
+ // with parseZone.
1372
+ if (config._tzm != null) {
1373
+ config._d.setUTCMinutes(config._d.getUTCMinutes() + config._tzm);
1374
+ }
1375
+ }
1376
+
1377
+ function dateFromObject(config) {
1378
+ var normalizedInput;
1379
+
1380
+ if (config._d) {
1381
+ return;
1382
+ }
1383
+
1384
+ normalizedInput = normalizeObjectUnits(config._i);
1385
+ config._a = [
1386
+ normalizedInput.year,
1387
+ normalizedInput.month,
1388
+ normalizedInput.day,
1389
+ normalizedInput.hour,
1390
+ normalizedInput.minute,
1391
+ normalizedInput.second,
1392
+ normalizedInput.millisecond
1393
+ ];
1394
+
1395
+ dateFromConfig(config);
1396
+ }
1397
+
1398
+ function currentDateArray(config) {
1399
+ var now = new Date();
1400
+ if (config._useUTC) {
1401
+ return [
1402
+ now.getUTCFullYear(),
1403
+ now.getUTCMonth(),
1404
+ now.getUTCDate()
1405
+ ];
1406
+ } else {
1407
+ return [now.getFullYear(), now.getMonth(), now.getDate()];
1408
+ }
1409
+ }
1410
+
1411
+ // date from string and format string
1412
+ function makeDateFromStringAndFormat(config) {
1413
+ if (config._f === moment.ISO_8601) {
1414
+ parseISO(config);
1415
+ return;
1416
+ }
1417
+
1418
+ config._a = [];
1419
+ config._pf.empty = true;
1420
+
1421
+ // This array is used to make a Date, either with `new Date` or `Date.UTC`
1422
+ var string = '' + config._i,
1423
+ i, parsedInput, tokens, token, skipped,
1424
+ stringLength = string.length,
1425
+ totalParsedInputLength = 0;
1426
+
1427
+ tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
1428
+
1429
+ for (i = 0; i < tokens.length; i++) {
1430
+ token = tokens[i];
1431
+ parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
1432
+ if (parsedInput) {
1433
+ skipped = string.substr(0, string.indexOf(parsedInput));
1434
+ if (skipped.length > 0) {
1435
+ config._pf.unusedInput.push(skipped);
1436
+ }
1437
+ string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
1438
+ totalParsedInputLength += parsedInput.length;
1439
+ }
1440
+ // don't parse if it's not a known token
1441
+ if (formatTokenFunctions[token]) {
1442
+ if (parsedInput) {
1443
+ config._pf.empty = false;
1444
+ }
1445
+ else {
1446
+ config._pf.unusedTokens.push(token);
1447
+ }
1448
+ addTimeToArrayFromToken(token, parsedInput, config);
1449
+ }
1450
+ else if (config._strict && !parsedInput) {
1451
+ config._pf.unusedTokens.push(token);
1452
+ }
1453
+ }
1454
+
1455
+ // add remaining unparsed input length to the string
1456
+ config._pf.charsLeftOver = stringLength - totalParsedInputLength;
1457
+ if (string.length > 0) {
1458
+ config._pf.unusedInput.push(string);
1459
+ }
1460
+
1461
+ // handle am pm
1462
+ if (config._isPm && config._a[HOUR] < 12) {
1463
+ config._a[HOUR] += 12;
1464
+ }
1465
+ // if is 12 am, change hours to 0
1466
+ if (config._isPm === false && config._a[HOUR] === 12) {
1467
+ config._a[HOUR] = 0;
1468
+ }
1469
+
1470
+ dateFromConfig(config);
1471
+ checkOverflow(config);
1472
+ }
1473
+
1474
+ function unescapeFormat(s) {
1475
+ return s.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) {
1476
+ return p1 || p2 || p3 || p4;
1477
+ });
1478
+ }
1479
+
1480
+ // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
1481
+ function regexpEscape(s) {
1482
+ return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
1483
+ }
1484
+
1485
+ // date from string and array of format strings
1486
+ function makeDateFromStringAndArray(config) {
1487
+ var tempConfig,
1488
+ bestMoment,
1489
+
1490
+ scoreToBeat,
1491
+ i,
1492
+ currentScore;
1493
+
1494
+ if (config._f.length === 0) {
1495
+ config._pf.invalidFormat = true;
1496
+ config._d = new Date(NaN);
1497
+ return;
1498
+ }
1499
+
1500
+ for (i = 0; i < config._f.length; i++) {
1501
+ currentScore = 0;
1502
+ tempConfig = copyConfig({}, config);
1503
+ if (config._useUTC != null) {
1504
+ tempConfig._useUTC = config._useUTC;
1505
+ }
1506
+ tempConfig._pf = defaultParsingFlags();
1507
+ tempConfig._f = config._f[i];
1508
+ makeDateFromStringAndFormat(tempConfig);
1509
+
1510
+ if (!isValid(tempConfig)) {
1511
+ continue;
1512
+ }
1513
+
1514
+ // if there is any input that was not parsed add a penalty for that format
1515
+ currentScore += tempConfig._pf.charsLeftOver;
1516
+
1517
+ //or tokens
1518
+ currentScore += tempConfig._pf.unusedTokens.length * 10;
1519
+
1520
+ tempConfig._pf.score = currentScore;
1521
+
1522
+ if (scoreToBeat == null || currentScore < scoreToBeat) {
1523
+ scoreToBeat = currentScore;
1524
+ bestMoment = tempConfig;
1525
+ }
1526
+ }
1527
+
1528
+ extend(config, bestMoment || tempConfig);
1529
+ }
1530
+
1531
+ // date from iso format
1532
+ function parseISO(config) {
1533
+ var i, l,
1534
+ string = config._i,
1535
+ match = isoRegex.exec(string);
1536
+
1537
+ if (match) {
1538
+ config._pf.iso = true;
1539
+ for (i = 0, l = isoDates.length; i < l; i++) {
1540
+ if (isoDates[i][1].exec(string)) {
1541
+ // match[5] should be 'T' or undefined
1542
+ config._f = isoDates[i][0] + (match[6] || ' ');
1543
+ break;
1544
+ }
1545
+ }
1546
+ for (i = 0, l = isoTimes.length; i < l; i++) {
1547
+ if (isoTimes[i][1].exec(string)) {
1548
+ config._f += isoTimes[i][0];
1549
+ break;
1550
+ }
1551
+ }
1552
+ if (string.match(parseTokenTimezone)) {
1553
+ config._f += 'Z';
1554
+ }
1555
+ makeDateFromStringAndFormat(config);
1556
+ } else {
1557
+ config._isValid = false;
1558
+ }
1559
+ }
1560
+
1561
+ // date from iso format or fallback
1562
+ function makeDateFromString(config) {
1563
+ parseISO(config);
1564
+ if (config._isValid === false) {
1565
+ delete config._isValid;
1566
+ moment.createFromInputFallback(config);
1567
+ }
1568
+ }
1569
+
1570
+ function map(arr, fn) {
1571
+ var res = [], i;
1572
+ for (i = 0; i < arr.length; ++i) {
1573
+ res.push(fn(arr[i], i));
1574
+ }
1575
+ return res;
1576
+ }
1577
+
1578
+ function makeDateFromInput(config) {
1579
+ var input = config._i, matched;
1580
+ if (input === undefined) {
1581
+ config._d = new Date();
1582
+ } else if (isDate(input)) {
1583
+ config._d = new Date(+input);
1584
+ } else if ((matched = aspNetJsonRegex.exec(input)) !== null) {
1585
+ config._d = new Date(+matched[1]);
1586
+ } else if (typeof input === 'string') {
1587
+ makeDateFromString(config);
1588
+ } else if (isArray(input)) {
1589
+ config._a = map(input.slice(0), function (obj) {
1590
+ return parseInt(obj, 10);
1591
+ });
1592
+ dateFromConfig(config);
1593
+ } else if (typeof(input) === 'object') {
1594
+ dateFromObject(config);
1595
+ } else if (typeof(input) === 'number') {
1596
+ // from milliseconds
1597
+ config._d = new Date(input);
1598
+ } else {
1599
+ moment.createFromInputFallback(config);
1600
+ }
1601
+ }
1602
+
1603
+ function makeDate(y, m, d, h, M, s, ms) {
1604
+ //can't just apply() to create a date:
1605
+ //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply
1606
+ var date = new Date(y, m, d, h, M, s, ms);
1607
+
1608
+ //the date constructor doesn't accept years < 1970
1609
+ if (y < 1970) {
1610
+ date.setFullYear(y);
1611
+ }
1612
+ return date;
1613
+ }
1614
+
1615
+ function makeUTCDate(y) {
1616
+ var date = new Date(Date.UTC.apply(null, arguments));
1617
+ if (y < 1970) {
1618
+ date.setUTCFullYear(y);
1619
+ }
1620
+ return date;
1621
+ }
1622
+
1623
+ function parseWeekday(input, locale) {
1624
+ if (typeof input === 'string') {
1625
+ if (!isNaN(input)) {
1626
+ input = parseInt(input, 10);
1627
+ }
1628
+ else {
1629
+ input = locale.weekdaysParse(input);
1630
+ if (typeof input !== 'number') {
1631
+ return null;
1632
+ }
1633
+ }
1634
+ }
1635
+ return input;
1636
+ }
1637
+
1638
+ /************************************
1639
+ Relative Time
1640
+ ************************************/
1641
+
1642
+
1643
+ // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
1644
+ function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
1645
+ return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
1646
+ }
1647
+
1648
+ function relativeTime(posNegDuration, withoutSuffix, locale) {
1649
+ var duration = moment.duration(posNegDuration).abs(),
1650
+ seconds = round(duration.as('s')),
1651
+ minutes = round(duration.as('m')),
1652
+ hours = round(duration.as('h')),
1653
+ days = round(duration.as('d')),
1654
+ months = round(duration.as('M')),
1655
+ years = round(duration.as('y')),
1656
+
1657
+ args = seconds < relativeTimeThresholds.s && ['s', seconds] ||
1658
+ minutes === 1 && ['m'] ||
1659
+ minutes < relativeTimeThresholds.m && ['mm', minutes] ||
1660
+ hours === 1 && ['h'] ||
1661
+ hours < relativeTimeThresholds.h && ['hh', hours] ||
1662
+ days === 1 && ['d'] ||
1663
+ days < relativeTimeThresholds.d && ['dd', days] ||
1664
+ months === 1 && ['M'] ||
1665
+ months < relativeTimeThresholds.M && ['MM', months] ||
1666
+ years === 1 && ['y'] || ['yy', years];
1667
+
1668
+ args[2] = withoutSuffix;
1669
+ args[3] = +posNegDuration > 0;
1670
+ args[4] = locale;
1671
+ return substituteTimeAgo.apply({}, args);
1672
+ }
1673
+
1674
+
1675
+ /************************************
1676
+ Week of Year
1677
+ ************************************/
1678
+
1679
+
1680
+ // firstDayOfWeek 0 = sun, 6 = sat
1681
+ // the day of the week that starts the week
1682
+ // (usually sunday or monday)
1683
+ // firstDayOfWeekOfYear 0 = sun, 6 = sat
1684
+ // the first week is the week that contains the first
1685
+ // of this day of the week
1686
+ // (eg. ISO weeks use thursday (4))
1687
+ function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) {
1688
+ var end = firstDayOfWeekOfYear - firstDayOfWeek,
1689
+ daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(),
1690
+ adjustedMoment;
1691
+
1692
+
1693
+ if (daysToDayOfWeek > end) {
1694
+ daysToDayOfWeek -= 7;
1695
+ }
1696
+
1697
+ if (daysToDayOfWeek < end - 7) {
1698
+ daysToDayOfWeek += 7;
1699
+ }
1700
+
1701
+ adjustedMoment = moment(mom).add(daysToDayOfWeek, 'd');
1702
+ return {
1703
+ week: Math.ceil(adjustedMoment.dayOfYear() / 7),
1704
+ year: adjustedMoment.year()
1705
+ };
1706
+ }
1707
+
1708
+ //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
1709
+ function dayOfYearFromWeeks(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) {
1710
+ var d = makeUTCDate(year, 0, 1).getUTCDay(), daysToAdd, dayOfYear;
1711
+
1712
+ d = d === 0 ? 7 : d;
1713
+ weekday = weekday != null ? weekday : firstDayOfWeek;
1714
+ daysToAdd = firstDayOfWeek - d + (d > firstDayOfWeekOfYear ? 7 : 0) - (d < firstDayOfWeek ? 7 : 0);
1715
+ dayOfYear = 7 * (week - 1) + (weekday - firstDayOfWeek) + daysToAdd + 1;
1716
+
1717
+ return {
1718
+ year: dayOfYear > 0 ? year : year - 1,
1719
+ dayOfYear: dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear
1720
+ };
1721
+ }
1722
+
1723
+ /************************************
1724
+ Top Level Functions
1725
+ ************************************/
1726
+
1727
+ function makeMoment(config) {
1728
+ var input = config._i,
1729
+ format = config._f;
1730
+
1731
+ config._locale = config._locale || moment.localeData(config._l);
1732
+
1733
+ if (input === null || (format === undefined && input === '')) {
1734
+ return moment.invalid({nullInput: true});
1735
+ }
1736
+
1737
+ if (typeof input === 'string') {
1738
+ config._i = input = config._locale.preparse(input);
1739
+ }
1740
+
1741
+ if (moment.isMoment(input)) {
1742
+ return new Moment(input, true);
1743
+ } else if (format) {
1744
+ if (isArray(format)) {
1745
+ makeDateFromStringAndArray(config);
1746
+ } else {
1747
+ makeDateFromStringAndFormat(config);
1748
+ }
1749
+ } else {
1750
+ makeDateFromInput(config);
1751
+ }
1752
+
1753
+ return new Moment(config);
1754
+ }
1755
+
1756
+ moment = function (input, format, locale, strict) {
1757
+ var c;
1758
+
1759
+ if (typeof(locale) === 'boolean') {
1760
+ strict = locale;
1761
+ locale = undefined;
1762
+ }
1763
+ // object construction must be done this way.
1764
+ // https://github.com/moment/moment/issues/1423
1765
+ c = {};
1766
+ c._isAMomentObject = true;
1767
+ c._i = input;
1768
+ c._f = format;
1769
+ c._l = locale;
1770
+ c._strict = strict;
1771
+ c._isUTC = false;
1772
+ c._pf = defaultParsingFlags();
1773
+
1774
+ return makeMoment(c);
1775
+ };
1776
+
1777
+ moment.suppressDeprecationWarnings = false;
1778
+
1779
+ moment.createFromInputFallback = deprecate(
1780
+ 'moment construction falls back to js Date. This is ' +
1781
+ 'discouraged and will be removed in upcoming major ' +
1782
+ 'release. Please refer to ' +
1783
+ 'https://github.com/moment/moment/issues/1407 for more info.',
1784
+ function (config) {
1785
+ config._d = new Date(config._i);
1786
+ }
1787
+ );
1788
+
1789
+ // Pick a moment m from moments so that m[fn](other) is true for all
1790
+ // other. This relies on the function fn to be transitive.
1791
+ //
1792
+ // moments should either be an array of moment objects or an array, whose
1793
+ // first element is an array of moment objects.
1794
+ function pickBy(fn, moments) {
1795
+ var res, i;
1796
+ if (moments.length === 1 && isArray(moments[0])) {
1797
+ moments = moments[0];
1798
+ }
1799
+ if (!moments.length) {
1800
+ return moment();
1801
+ }
1802
+ res = moments[0];
1803
+ for (i = 1; i < moments.length; ++i) {
1804
+ if (moments[i][fn](res)) {
1805
+ res = moments[i];
1806
+ }
1807
+ }
1808
+ return res;
1809
+ }
1810
+
1811
+ moment.min = function () {
1812
+ var args = [].slice.call(arguments, 0);
1813
+
1814
+ return pickBy('isBefore', args);
1815
+ };
1816
+
1817
+ moment.max = function () {
1818
+ var args = [].slice.call(arguments, 0);
1819
+
1820
+ return pickBy('isAfter', args);
1821
+ };
1822
+
1823
+ // creating with utc
1824
+ moment.utc = function (input, format, locale, strict) {
1825
+ var c;
1826
+
1827
+ if (typeof(locale) === 'boolean') {
1828
+ strict = locale;
1829
+ locale = undefined;
1830
+ }
1831
+ // object construction must be done this way.
1832
+ // https://github.com/moment/moment/issues/1423
1833
+ c = {};
1834
+ c._isAMomentObject = true;
1835
+ c._useUTC = true;
1836
+ c._isUTC = true;
1837
+ c._l = locale;
1838
+ c._i = input;
1839
+ c._f = format;
1840
+ c._strict = strict;
1841
+ c._pf = defaultParsingFlags();
1842
+
1843
+ return makeMoment(c).utc();
1844
+ };
1845
+
1846
+ // creating with unix timestamp (in seconds)
1847
+ moment.unix = function (input) {
1848
+ return moment(input * 1000);
1849
+ };
1850
+
1851
+ // duration
1852
+ moment.duration = function (input, key) {
1853
+ var duration = input,
1854
+ // matching against regexp is expensive, do it on demand
1855
+ match = null,
1856
+ sign,
1857
+ ret,
1858
+ parseIso,
1859
+ diffRes;
1860
+
1861
+ if (moment.isDuration(input)) {
1862
+ duration = {
1863
+ ms: input._milliseconds,
1864
+ d: input._days,
1865
+ M: input._months
1866
+ };
1867
+ } else if (typeof input === 'number') {
1868
+ duration = {};
1869
+ if (key) {
1870
+ duration[key] = input;
1871
+ } else {
1872
+ duration.milliseconds = input;
1873
+ }
1874
+ } else if (!!(match = aspNetTimeSpanJsonRegex.exec(input))) {
1875
+ sign = (match[1] === '-') ? -1 : 1;
1876
+ duration = {
1877
+ y: 0,
1878
+ d: toInt(match[DATE]) * sign,
1879
+ h: toInt(match[HOUR]) * sign,
1880
+ m: toInt(match[MINUTE]) * sign,
1881
+ s: toInt(match[SECOND]) * sign,
1882
+ ms: toInt(match[MILLISECOND]) * sign
1883
+ };
1884
+ } else if (!!(match = isoDurationRegex.exec(input))) {
1885
+ sign = (match[1] === '-') ? -1 : 1;
1886
+ parseIso = function (inp) {
1887
+ // We'd normally use ~~inp for this, but unfortunately it also
1888
+ // converts floats to ints.
1889
+ // inp may be undefined, so careful calling replace on it.
1890
+ var res = inp && parseFloat(inp.replace(',', '.'));
1891
+ // apply sign while we're at it
1892
+ return (isNaN(res) ? 0 : res) * sign;
1893
+ };
1894
+ duration = {
1895
+ y: parseIso(match[2]),
1896
+ M: parseIso(match[3]),
1897
+ d: parseIso(match[4]),
1898
+ h: parseIso(match[5]),
1899
+ m: parseIso(match[6]),
1900
+ s: parseIso(match[7]),
1901
+ w: parseIso(match[8])
1902
+ };
1903
+ } else if (typeof duration === 'object' &&
1904
+ ('from' in duration || 'to' in duration)) {
1905
+ diffRes = momentsDifference(moment(duration.from), moment(duration.to));
1906
+
1907
+ duration = {};
1908
+ duration.ms = diffRes.milliseconds;
1909
+ duration.M = diffRes.months;
1910
+ }
1911
+
1912
+ ret = new Duration(duration);
1913
+
1914
+ if (moment.isDuration(input) && hasOwnProp(input, '_locale')) {
1915
+ ret._locale = input._locale;
1916
+ }
1917
+
1918
+ return ret;
1919
+ };
1920
+
1921
+ // version number
1922
+ moment.version = VERSION;
1923
+
1924
+ // default format
1925
+ moment.defaultFormat = isoFormat;
1926
+
1927
+ // constant that refers to the ISO standard
1928
+ moment.ISO_8601 = function () {};
1929
+
1930
+ // Plugins that add properties should also add the key here (null value),
1931
+ // so we can properly clone ourselves.
1932
+ moment.momentProperties = momentProperties;
1933
+
1934
+ // This function will be called whenever a moment is mutated.
1935
+ // It is intended to keep the offset in sync with the timezone.
1936
+ moment.updateOffset = function () {};
1937
+
1938
+ // This function allows you to set a threshold for relative time strings
1939
+ moment.relativeTimeThreshold = function (threshold, limit) {
1940
+ if (relativeTimeThresholds[threshold] === undefined) {
1941
+ return false;
1942
+ }
1943
+ if (limit === undefined) {
1944
+ return relativeTimeThresholds[threshold];
1945
+ }
1946
+ relativeTimeThresholds[threshold] = limit;
1947
+ return true;
1948
+ };
1949
+
1950
+ moment.lang = deprecate(
1951
+ 'moment.lang is deprecated. Use moment.locale instead.',
1952
+ function (key, value) {
1953
+ return moment.locale(key, value);
1954
+ }
1955
+ );
1956
+
1957
+ // This function will load locale and then set the global locale. If
1958
+ // no arguments are passed in, it will simply return the current global
1959
+ // locale key.
1960
+ moment.locale = function (key, values) {
1961
+ var data;
1962
+ if (key) {
1963
+ if (typeof(values) !== 'undefined') {
1964
+ data = moment.defineLocale(key, values);
1965
+ }
1966
+ else {
1967
+ data = moment.localeData(key);
1968
+ }
1969
+
1970
+ if (data) {
1971
+ moment.duration._locale = moment._locale = data;
1972
+ }
1973
+ }
1974
+
1975
+ return moment._locale._abbr;
1976
+ };
1977
+
1978
+ moment.defineLocale = function (name, values) {
1979
+ if (values !== null) {
1980
+ values.abbr = name;
1981
+ if (!locales[name]) {
1982
+ locales[name] = new Locale();
1983
+ }
1984
+ locales[name].set(values);
1985
+
1986
+ // backwards compat for now: also set the locale
1987
+ moment.locale(name);
1988
+
1989
+ return locales[name];
1990
+ } else {
1991
+ // useful for testing
1992
+ delete locales[name];
1993
+ return null;
1994
+ }
1995
+ };
1996
+
1997
+ moment.langData = deprecate(
1998
+ 'moment.langData is deprecated. Use moment.localeData instead.',
1999
+ function (key) {
2000
+ return moment.localeData(key);
2001
+ }
2002
+ );
2003
+
2004
+ // returns locale data
2005
+ moment.localeData = function (key) {
2006
+ var locale;
2007
+
2008
+ if (key && key._locale && key._locale._abbr) {
2009
+ key = key._locale._abbr;
2010
+ }
2011
+
2012
+ if (!key) {
2013
+ return moment._locale;
2014
+ }
2015
+
2016
+ if (!isArray(key)) {
2017
+ //short-circuit everything else
2018
+ locale = loadLocale(key);
2019
+ if (locale) {
2020
+ return locale;
2021
+ }
2022
+ key = [key];
2023
+ }
2024
+
2025
+ return chooseLocale(key);
2026
+ };
2027
+
2028
+ // compare moment object
2029
+ moment.isMoment = function (obj) {
2030
+ return obj instanceof Moment ||
2031
+ (obj != null && hasOwnProp(obj, '_isAMomentObject'));
2032
+ };
2033
+
2034
+ // for typechecking Duration objects
2035
+ moment.isDuration = function (obj) {
2036
+ return obj instanceof Duration;
2037
+ };
2038
+
2039
+ for (i = lists.length - 1; i >= 0; --i) {
2040
+ makeList(lists[i]);
2041
+ }
2042
+
2043
+ moment.normalizeUnits = function (units) {
2044
+ return normalizeUnits(units);
2045
+ };
2046
+
2047
+ moment.invalid = function (flags) {
2048
+ var m = moment.utc(NaN);
2049
+ if (flags != null) {
2050
+ extend(m._pf, flags);
2051
+ }
2052
+ else {
2053
+ m._pf.userInvalidated = true;
2054
+ }
2055
+
2056
+ return m;
2057
+ };
2058
+
2059
+ moment.parseZone = function () {
2060
+ return moment.apply(null, arguments).parseZone();
2061
+ };
2062
+
2063
+ moment.parseTwoDigitYear = function (input) {
2064
+ return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
2065
+ };
2066
+
2067
+ /************************************
2068
+ Moment Prototype
2069
+ ************************************/
2070
+
2071
+
2072
+ extend(moment.fn = Moment.prototype, {
2073
+
2074
+ clone : function () {
2075
+ return moment(this);
2076
+ },
2077
+
2078
+ valueOf : function () {
2079
+ return +this._d + ((this._offset || 0) * 60000);
2080
+ },
2081
+
2082
+ unix : function () {
2083
+ return Math.floor(+this / 1000);
2084
+ },
2085
+
2086
+ toString : function () {
2087
+ return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
2088
+ },
2089
+
2090
+ toDate : function () {
2091
+ return this._offset ? new Date(+this) : this._d;
2092
+ },
2093
+
2094
+ toISOString : function () {
2095
+ var m = moment(this).utc();
2096
+ if (0 < m.year() && m.year() <= 9999) {
2097
+ return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
2098
+ } else {
2099
+ return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
2100
+ }
2101
+ },
2102
+
2103
+ toArray : function () {
2104
+ var m = this;
2105
+ return [
2106
+ m.year(),
2107
+ m.month(),
2108
+ m.date(),
2109
+ m.hours(),
2110
+ m.minutes(),
2111
+ m.seconds(),
2112
+ m.milliseconds()
2113
+ ];
2114
+ },
2115
+
2116
+ isValid : function () {
2117
+ return isValid(this);
2118
+ },
2119
+
2120
+ isDSTShifted : function () {
2121
+ if (this._a) {
2122
+ return this.isValid() && compareArrays(this._a, (this._isUTC ? moment.utc(this._a) : moment(this._a)).toArray()) > 0;
2123
+ }
2124
+
2125
+ return false;
2126
+ },
2127
+
2128
+ parsingFlags : function () {
2129
+ return extend({}, this._pf);
2130
+ },
2131
+
2132
+ invalidAt: function () {
2133
+ return this._pf.overflow;
2134
+ },
2135
+
2136
+ utc : function (keepLocalTime) {
2137
+ return this.zone(0, keepLocalTime);
2138
+ },
2139
+
2140
+ local : function (keepLocalTime) {
2141
+ if (this._isUTC) {
2142
+ this.zone(0, keepLocalTime);
2143
+ this._isUTC = false;
2144
+
2145
+ if (keepLocalTime) {
2146
+ this.add(this._dateTzOffset(), 'm');
2147
+ }
2148
+ }
2149
+ return this;
2150
+ },
2151
+
2152
+ format : function (inputString) {
2153
+ var output = formatMoment(this, inputString || moment.defaultFormat);
2154
+ return this.localeData().postformat(output);
2155
+ },
2156
+
2157
+ add : createAdder(1, 'add'),
2158
+
2159
+ subtract : createAdder(-1, 'subtract'),
2160
+
2161
+ diff : function (input, units, asFloat) {
2162
+ var that = makeAs(input, this),
2163
+ zoneDiff = (this.zone() - that.zone()) * 6e4,
2164
+ diff, output, daysAdjust;
2165
+
2166
+ units = normalizeUnits(units);
2167
+
2168
+ if (units === 'year' || units === 'month') {
2169
+ // average number of days in the months in the given dates
2170
+ diff = (this.daysInMonth() + that.daysInMonth()) * 432e5; // 24 * 60 * 60 * 1000 / 2
2171
+ // difference in months
2172
+ output = ((this.year() - that.year()) * 12) + (this.month() - that.month());
2173
+ // adjust by taking difference in days, average number of days
2174
+ // and dst in the given months.
2175
+ daysAdjust = (this - moment(this).startOf('month')) -
2176
+ (that - moment(that).startOf('month'));
2177
+ // same as above but with zones, to negate all dst
2178
+ daysAdjust -= ((this.zone() - moment(this).startOf('month').zone()) -
2179
+ (that.zone() - moment(that).startOf('month').zone())) * 6e4;
2180
+ output += daysAdjust / diff;
2181
+ if (units === 'year') {
2182
+ output = output / 12;
2183
+ }
2184
+ } else {
2185
+ diff = (this - that);
2186
+ output = units === 'second' ? diff / 1e3 : // 1000
2187
+ units === 'minute' ? diff / 6e4 : // 1000 * 60
2188
+ units === 'hour' ? diff / 36e5 : // 1000 * 60 * 60
2189
+ units === 'day' ? (diff - zoneDiff) / 864e5 : // 1000 * 60 * 60 * 24, negate dst
2190
+ units === 'week' ? (diff - zoneDiff) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst
2191
+ diff;
2192
+ }
2193
+ return asFloat ? output : absRound(output);
2194
+ },
2195
+
2196
+ from : function (time, withoutSuffix) {
2197
+ return moment.duration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);
2198
+ },
2199
+
2200
+ fromNow : function (withoutSuffix) {
2201
+ return this.from(moment(), withoutSuffix);
2202
+ },
2203
+
2204
+ calendar : function (time) {
2205
+ // We want to compare the start of today, vs this.
2206
+ // Getting start-of-today depends on whether we're zone'd or not.
2207
+ var now = time || moment(),
2208
+ sod = makeAs(now, this).startOf('day'),
2209
+ diff = this.diff(sod, 'days', true),
2210
+ format = diff < -6 ? 'sameElse' :
2211
+ diff < -1 ? 'lastWeek' :
2212
+ diff < 0 ? 'lastDay' :
2213
+ diff < 1 ? 'sameDay' :
2214
+ diff < 2 ? 'nextDay' :
2215
+ diff < 7 ? 'nextWeek' : 'sameElse';
2216
+ return this.format(this.localeData().calendar(format, this));
2217
+ },
2218
+
2219
+ isLeapYear : function () {
2220
+ return isLeapYear(this.year());
2221
+ },
2222
+
2223
+ isDST : function () {
2224
+ return (this.zone() < this.clone().month(0).zone() ||
2225
+ this.zone() < this.clone().month(5).zone());
2226
+ },
2227
+
2228
+ day : function (input) {
2229
+ var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
2230
+ if (input != null) {
2231
+ input = parseWeekday(input, this.localeData());
2232
+ return this.add(input - day, 'd');
2233
+ } else {
2234
+ return day;
2235
+ }
2236
+ },
2237
+
2238
+ month : makeAccessor('Month', true),
2239
+
2240
+ startOf : function (units) {
2241
+ units = normalizeUnits(units);
2242
+ // the following switch intentionally omits break keywords
2243
+ // to utilize falling through the cases.
2244
+ switch (units) {
2245
+ case 'year':
2246
+ this.month(0);
2247
+ /* falls through */
2248
+ case 'quarter':
2249
+ case 'month':
2250
+ this.date(1);
2251
+ /* falls through */
2252
+ case 'week':
2253
+ case 'isoWeek':
2254
+ case 'day':
2255
+ this.hours(0);
2256
+ /* falls through */
2257
+ case 'hour':
2258
+ this.minutes(0);
2259
+ /* falls through */
2260
+ case 'minute':
2261
+ this.seconds(0);
2262
+ /* falls through */
2263
+ case 'second':
2264
+ this.milliseconds(0);
2265
+ /* falls through */
2266
+ }
2267
+
2268
+ // weeks are a special case
2269
+ if (units === 'week') {
2270
+ this.weekday(0);
2271
+ } else if (units === 'isoWeek') {
2272
+ this.isoWeekday(1);
2273
+ }
2274
+
2275
+ // quarters are also special
2276
+ if (units === 'quarter') {
2277
+ this.month(Math.floor(this.month() / 3) * 3);
2278
+ }
2279
+
2280
+ return this;
2281
+ },
2282
+
2283
+ endOf: function (units) {
2284
+ units = normalizeUnits(units);
2285
+ return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');
2286
+ },
2287
+
2288
+ isAfter: function (input, units) {
2289
+ units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond');
2290
+ if (units === 'millisecond') {
2291
+ input = moment.isMoment(input) ? input : moment(input);
2292
+ return +this > +input;
2293
+ } else {
2294
+ return +this.clone().startOf(units) > +moment(input).startOf(units);
2295
+ }
2296
+ },
2297
+
2298
+ isBefore: function (input, units) {
2299
+ units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond');
2300
+ if (units === 'millisecond') {
2301
+ input = moment.isMoment(input) ? input : moment(input);
2302
+ return +this < +input;
2303
+ } else {
2304
+ return +this.clone().startOf(units) < +moment(input).startOf(units);
2305
+ }
2306
+ },
2307
+
2308
+ isSame: function (input, units) {
2309
+ units = normalizeUnits(units || 'millisecond');
2310
+ if (units === 'millisecond') {
2311
+ input = moment.isMoment(input) ? input : moment(input);
2312
+ return +this === +input;
2313
+ } else {
2314
+ return +this.clone().startOf(units) === +makeAs(input, this).startOf(units);
2315
+ }
2316
+ },
2317
+
2318
+ min: deprecate(
2319
+ 'moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548',
2320
+ function (other) {
2321
+ other = moment.apply(null, arguments);
2322
+ return other < this ? this : other;
2323
+ }
2324
+ ),
2325
+
2326
+ max: deprecate(
2327
+ 'moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548',
2328
+ function (other) {
2329
+ other = moment.apply(null, arguments);
2330
+ return other > this ? this : other;
2331
+ }
2332
+ ),
2333
+
2334
+ // keepLocalTime = true means only change the timezone, without
2335
+ // affecting the local hour. So 5:31:26 +0300 --[zone(2, true)]-->
2336
+ // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist int zone
2337
+ // +0200, so we adjust the time as needed, to be valid.
2338
+ //
2339
+ // Keeping the time actually adds/subtracts (one hour)
2340
+ // from the actual represented time. That is why we call updateOffset
2341
+ // a second time. In case it wants us to change the offset again
2342
+ // _changeInProgress == true case, then we have to adjust, because
2343
+ // there is no such time in the given timezone.
2344
+ zone : function (input, keepLocalTime) {
2345
+ var offset = this._offset || 0,
2346
+ localAdjust;
2347
+ if (input != null) {
2348
+ if (typeof input === 'string') {
2349
+ input = timezoneMinutesFromString(input);
2350
+ }
2351
+ if (Math.abs(input) < 16) {
2352
+ input = input * 60;
2353
+ }
2354
+ if (!this._isUTC && keepLocalTime) {
2355
+ localAdjust = this._dateTzOffset();
2356
+ }
2357
+ this._offset = input;
2358
+ this._isUTC = true;
2359
+ if (localAdjust != null) {
2360
+ this.subtract(localAdjust, 'm');
2361
+ }
2362
+ if (offset !== input) {
2363
+ if (!keepLocalTime || this._changeInProgress) {
2364
+ addOrSubtractDurationFromMoment(this,
2365
+ moment.duration(offset - input, 'm'), 1, false);
2366
+ } else if (!this._changeInProgress) {
2367
+ this._changeInProgress = true;
2368
+ moment.updateOffset(this, true);
2369
+ this._changeInProgress = null;
2370
+ }
2371
+ }
2372
+ } else {
2373
+ return this._isUTC ? offset : this._dateTzOffset();
2374
+ }
2375
+ return this;
2376
+ },
2377
+
2378
+ zoneAbbr : function () {
2379
+ return this._isUTC ? 'UTC' : '';
2380
+ },
2381
+
2382
+ zoneName : function () {
2383
+ return this._isUTC ? 'Coordinated Universal Time' : '';
2384
+ },
2385
+
2386
+ parseZone : function () {
2387
+ if (this._tzm) {
2388
+ this.zone(this._tzm);
2389
+ } else if (typeof this._i === 'string') {
2390
+ this.zone(this._i);
2391
+ }
2392
+ return this;
2393
+ },
2394
+
2395
+ hasAlignedHourOffset : function (input) {
2396
+ if (!input) {
2397
+ input = 0;
2398
+ }
2399
+ else {
2400
+ input = moment(input).zone();
2401
+ }
2402
+
2403
+ return (this.zone() - input) % 60 === 0;
2404
+ },
2405
+
2406
+ daysInMonth : function () {
2407
+ return daysInMonth(this.year(), this.month());
2408
+ },
2409
+
2410
+ dayOfYear : function (input) {
2411
+ var dayOfYear = round((moment(this).startOf('day') - moment(this).startOf('year')) / 864e5) + 1;
2412
+ return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');
2413
+ },
2414
+
2415
+ quarter : function (input) {
2416
+ return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
2417
+ },
2418
+
2419
+ weekYear : function (input) {
2420
+ var year = weekOfYear(this, this.localeData()._week.dow, this.localeData()._week.doy).year;
2421
+ return input == null ? year : this.add((input - year), 'y');
2422
+ },
2423
+
2424
+ isoWeekYear : function (input) {
2425
+ var year = weekOfYear(this, 1, 4).year;
2426
+ return input == null ? year : this.add((input - year), 'y');
2427
+ },
2428
+
2429
+ week : function (input) {
2430
+ var week = this.localeData().week(this);
2431
+ return input == null ? week : this.add((input - week) * 7, 'd');
2432
+ },
2433
+
2434
+ isoWeek : function (input) {
2435
+ var week = weekOfYear(this, 1, 4).week;
2436
+ return input == null ? week : this.add((input - week) * 7, 'd');
2437
+ },
2438
+
2439
+ weekday : function (input) {
2440
+ var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
2441
+ return input == null ? weekday : this.add(input - weekday, 'd');
2442
+ },
2443
+
2444
+ isoWeekday : function (input) {
2445
+ // behaves the same as moment#day except
2446
+ // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
2447
+ // as a setter, sunday should belong to the previous week.
2448
+ return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7);
2449
+ },
2450
+
2451
+ isoWeeksInYear : function () {
2452
+ return weeksInYear(this.year(), 1, 4);
2453
+ },
2454
+
2455
+ weeksInYear : function () {
2456
+ var weekInfo = this.localeData()._week;
2457
+ return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
2458
+ },
2459
+
2460
+ get : function (units) {
2461
+ units = normalizeUnits(units);
2462
+ return this[units]();
2463
+ },
2464
+
2465
+ set : function (units, value) {
2466
+ units = normalizeUnits(units);
2467
+ if (typeof this[units] === 'function') {
2468
+ this[units](value);
2469
+ }
2470
+ return this;
2471
+ },
2472
+
2473
+ // If passed a locale key, it will set the locale for this
2474
+ // instance. Otherwise, it will return the locale configuration
2475
+ // variables for this instance.
2476
+ locale : function (key) {
2477
+ var newLocaleData;
2478
+
2479
+ if (key === undefined) {
2480
+ return this._locale._abbr;
2481
+ } else {
2482
+ newLocaleData = moment.localeData(key);
2483
+ if (newLocaleData != null) {
2484
+ this._locale = newLocaleData;
2485
+ }
2486
+ return this;
2487
+ }
2488
+ },
2489
+
2490
+ lang : deprecate(
2491
+ 'moment().lang() is deprecated. Use moment().localeData() instead.',
2492
+ function (key) {
2493
+ if (key === undefined) {
2494
+ return this.localeData();
2495
+ } else {
2496
+ return this.locale(key);
2497
+ }
2498
+ }
2499
+ ),
2500
+
2501
+ localeData : function () {
2502
+ return this._locale;
2503
+ },
2504
+
2505
+ _dateTzOffset : function () {
2506
+ // On Firefox.24 Date#getTimezoneOffset returns a floating point.
2507
+ // https://github.com/moment/moment/pull/1871
2508
+ return Math.round(this._d.getTimezoneOffset() / 15) * 15;
2509
+ }
2510
+ });
2511
+
2512
+ function rawMonthSetter(mom, value) {
2513
+ var dayOfMonth;
2514
+
2515
+ // TODO: Move this out of here!
2516
+ if (typeof value === 'string') {
2517
+ value = mom.localeData().monthsParse(value);
2518
+ // TODO: Another silent failure?
2519
+ if (typeof value !== 'number') {
2520
+ return mom;
2521
+ }
2522
+ }
2523
+
2524
+ dayOfMonth = Math.min(mom.date(),
2525
+ daysInMonth(mom.year(), value));
2526
+ mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
2527
+ return mom;
2528
+ }
2529
+
2530
+ function rawGetter(mom, unit) {
2531
+ return mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]();
2532
+ }
2533
+
2534
+ function rawSetter(mom, unit, value) {
2535
+ if (unit === 'Month') {
2536
+ return rawMonthSetter(mom, value);
2537
+ } else {
2538
+ return mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
2539
+ }
2540
+ }
2541
+
2542
+ function makeAccessor(unit, keepTime) {
2543
+ return function (value) {
2544
+ if (value != null) {
2545
+ rawSetter(this, unit, value);
2546
+ moment.updateOffset(this, keepTime);
2547
+ return this;
2548
+ } else {
2549
+ return rawGetter(this, unit);
2550
+ }
2551
+ };
2552
+ }
2553
+
2554
+ moment.fn.millisecond = moment.fn.milliseconds = makeAccessor('Milliseconds', false);
2555
+ moment.fn.second = moment.fn.seconds = makeAccessor('Seconds', false);
2556
+ moment.fn.minute = moment.fn.minutes = makeAccessor('Minutes', false);
2557
+ // Setting the hour should keep the time, because the user explicitly
2558
+ // specified which hour he wants. So trying to maintain the same hour (in
2559
+ // a new timezone) makes sense. Adding/subtracting hours does not follow
2560
+ // this rule.
2561
+ moment.fn.hour = moment.fn.hours = makeAccessor('Hours', true);
2562
+ // moment.fn.month is defined separately
2563
+ moment.fn.date = makeAccessor('Date', true);
2564
+ moment.fn.dates = deprecate('dates accessor is deprecated. Use date instead.', makeAccessor('Date', true));
2565
+ moment.fn.year = makeAccessor('FullYear', true);
2566
+ moment.fn.years = deprecate('years accessor is deprecated. Use year instead.', makeAccessor('FullYear', true));
2567
+
2568
+ // add plural methods
2569
+ moment.fn.days = moment.fn.day;
2570
+ moment.fn.months = moment.fn.month;
2571
+ moment.fn.weeks = moment.fn.week;
2572
+ moment.fn.isoWeeks = moment.fn.isoWeek;
2573
+ moment.fn.quarters = moment.fn.quarter;
2574
+
2575
+ // add aliased format methods
2576
+ moment.fn.toJSON = moment.fn.toISOString;
2577
+
2578
+ /************************************
2579
+ Duration Prototype
2580
+ ************************************/
2581
+
2582
+
2583
+ function daysToYears (days) {
2584
+ // 400 years have 146097 days (taking into account leap year rules)
2585
+ return days * 400 / 146097;
2586
+ }
2587
+
2588
+ function yearsToDays (years) {
2589
+ // years * 365 + absRound(years / 4) -
2590
+ // absRound(years / 100) + absRound(years / 400);
2591
+ return years * 146097 / 400;
2592
+ }
2593
+
2594
+ extend(moment.duration.fn = Duration.prototype, {
2595
+
2596
+ _bubble : function () {
2597
+ var milliseconds = this._milliseconds,
2598
+ days = this._days,
2599
+ months = this._months,
2600
+ data = this._data,
2601
+ seconds, minutes, hours, years = 0;
2602
+
2603
+ // The following code bubbles up values, see the tests for
2604
+ // examples of what that means.
2605
+ data.milliseconds = milliseconds % 1000;
2606
+
2607
+ seconds = absRound(milliseconds / 1000);
2608
+ data.seconds = seconds % 60;
2609
+
2610
+ minutes = absRound(seconds / 60);
2611
+ data.minutes = minutes % 60;
2612
+
2613
+ hours = absRound(minutes / 60);
2614
+ data.hours = hours % 24;
2615
+
2616
+ days += absRound(hours / 24);
2617
+
2618
+ // Accurately convert days to years, assume start from year 0.
2619
+ years = absRound(daysToYears(days));
2620
+ days -= absRound(yearsToDays(years));
2621
+
2622
+ // 30 days to a month
2623
+ // TODO (iskren): Use anchor date (like 1st Jan) to compute this.
2624
+ months += absRound(days / 30);
2625
+ days %= 30;
2626
+
2627
+ // 12 months -> 1 year
2628
+ years += absRound(months / 12);
2629
+ months %= 12;
2630
+
2631
+ data.days = days;
2632
+ data.months = months;
2633
+ data.years = years;
2634
+ },
2635
+
2636
+ abs : function () {
2637
+ this._milliseconds = Math.abs(this._milliseconds);
2638
+ this._days = Math.abs(this._days);
2639
+ this._months = Math.abs(this._months);
2640
+
2641
+ this._data.milliseconds = Math.abs(this._data.milliseconds);
2642
+ this._data.seconds = Math.abs(this._data.seconds);
2643
+ this._data.minutes = Math.abs(this._data.minutes);
2644
+ this._data.hours = Math.abs(this._data.hours);
2645
+ this._data.months = Math.abs(this._data.months);
2646
+ this._data.years = Math.abs(this._data.years);
2647
+
2648
+ return this;
2649
+ },
2650
+
2651
+ weeks : function () {
2652
+ return absRound(this.days() / 7);
2653
+ },
2654
+
2655
+ valueOf : function () {
2656
+ return this._milliseconds +
2657
+ this._days * 864e5 +
2658
+ (this._months % 12) * 2592e6 +
2659
+ toInt(this._months / 12) * 31536e6;
2660
+ },
2661
+
2662
+ humanize : function (withSuffix) {
2663
+ var output = relativeTime(this, !withSuffix, this.localeData());
2664
+
2665
+ if (withSuffix) {
2666
+ output = this.localeData().pastFuture(+this, output);
2667
+ }
2668
+
2669
+ return this.localeData().postformat(output);
2670
+ },
2671
+
2672
+ add : function (input, val) {
2673
+ // supports only 2.0-style add(1, 's') or add(moment)
2674
+ var dur = moment.duration(input, val);
2675
+
2676
+ this._milliseconds += dur._milliseconds;
2677
+ this._days += dur._days;
2678
+ this._months += dur._months;
2679
+
2680
+ this._bubble();
2681
+
2682
+ return this;
2683
+ },
2684
+
2685
+ subtract : function (input, val) {
2686
+ var dur = moment.duration(input, val);
2687
+
2688
+ this._milliseconds -= dur._milliseconds;
2689
+ this._days -= dur._days;
2690
+ this._months -= dur._months;
2691
+
2692
+ this._bubble();
2693
+
2694
+ return this;
2695
+ },
2696
+
2697
+ get : function (units) {
2698
+ units = normalizeUnits(units);
2699
+ return this[units.toLowerCase() + 's']();
2700
+ },
2701
+
2702
+ as : function (units) {
2703
+ var days, months;
2704
+ units = normalizeUnits(units);
2705
+
2706
+ if (units === 'month' || units === 'year') {
2707
+ days = this._days + this._milliseconds / 864e5;
2708
+ months = this._months + daysToYears(days) * 12;
2709
+ return units === 'month' ? months : months / 12;
2710
+ } else {
2711
+ // handle milliseconds separately because of floating point math errors (issue #1867)
2712
+ days = this._days + yearsToDays(this._months / 12);
2713
+ switch (units) {
2714
+ case 'week': return days / 7 + this._milliseconds / 6048e5;
2715
+ case 'day': return days + this._milliseconds / 864e5;
2716
+ case 'hour': return days * 24 + this._milliseconds / 36e5;
2717
+ case 'minute': return days * 24 * 60 + this._milliseconds / 6e4;
2718
+ case 'second': return days * 24 * 60 * 60 + this._milliseconds / 1000;
2719
+ // Math.floor prevents floating point math errors here
2720
+ case 'millisecond': return Math.floor(days * 24 * 60 * 60 * 1000) + this._milliseconds;
2721
+ default: throw new Error('Unknown unit ' + units);
2722
+ }
2723
+ }
2724
+ },
2725
+
2726
+ lang : moment.fn.lang,
2727
+ locale : moment.fn.locale,
2728
+
2729
+ toIsoString : deprecate(
2730
+ 'toIsoString() is deprecated. Please use toISOString() instead ' +
2731
+ '(notice the capitals)',
2732
+ function () {
2733
+ return this.toISOString();
2734
+ }
2735
+ ),
2736
+
2737
+ toISOString : function () {
2738
+ // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
2739
+ var years = Math.abs(this.years()),
2740
+ months = Math.abs(this.months()),
2741
+ days = Math.abs(this.days()),
2742
+ hours = Math.abs(this.hours()),
2743
+ minutes = Math.abs(this.minutes()),
2744
+ seconds = Math.abs(this.seconds() + this.milliseconds() / 1000);
2745
+
2746
+ if (!this.asSeconds()) {
2747
+ // this is the same as C#'s (Noda) and python (isodate)...
2748
+ // but not other JS (goog.date)
2749
+ return 'P0D';
2750
+ }
2751
+
2752
+ return (this.asSeconds() < 0 ? '-' : '') +
2753
+ 'P' +
2754
+ (years ? years + 'Y' : '') +
2755
+ (months ? months + 'M' : '') +
2756
+ (days ? days + 'D' : '') +
2757
+ ((hours || minutes || seconds) ? 'T' : '') +
2758
+ (hours ? hours + 'H' : '') +
2759
+ (minutes ? minutes + 'M' : '') +
2760
+ (seconds ? seconds + 'S' : '');
2761
+ },
2762
+
2763
+ localeData : function () {
2764
+ return this._locale;
2765
+ }
2766
+ });
2767
+
2768
+ moment.duration.fn.toString = moment.duration.fn.toISOString;
2769
+
2770
+ function makeDurationGetter(name) {
2771
+ moment.duration.fn[name] = function () {
2772
+ return this._data[name];
2773
+ };
2774
+ }
2775
+
2776
+ for (i in unitMillisecondFactors) {
2777
+ if (hasOwnProp(unitMillisecondFactors, i)) {
2778
+ makeDurationGetter(i.toLowerCase());
2779
+ }
2780
+ }
2781
+
2782
+ moment.duration.fn.asMilliseconds = function () {
2783
+ return this.as('ms');
2784
+ };
2785
+ moment.duration.fn.asSeconds = function () {
2786
+ return this.as('s');
2787
+ };
2788
+ moment.duration.fn.asMinutes = function () {
2789
+ return this.as('m');
2790
+ };
2791
+ moment.duration.fn.asHours = function () {
2792
+ return this.as('h');
2793
+ };
2794
+ moment.duration.fn.asDays = function () {
2795
+ return this.as('d');
2796
+ };
2797
+ moment.duration.fn.asWeeks = function () {
2798
+ return this.as('weeks');
2799
+ };
2800
+ moment.duration.fn.asMonths = function () {
2801
+ return this.as('M');
2802
+ };
2803
+ moment.duration.fn.asYears = function () {
2804
+ return this.as('y');
2805
+ };
2806
+
2807
+ /************************************
2808
+ Default Locale
2809
+ ************************************/
2810
+
2811
+
2812
+ // Set default locale, other locale will inherit from English.
2813
+ moment.locale('en', {
2814
+ ordinal : function (number) {
2815
+ var b = number % 10,
2816
+ output = (toInt(number % 100 / 10) === 1) ? 'th' :
2817
+ (b === 1) ? 'st' :
2818
+ (b === 2) ? 'nd' :
2819
+ (b === 3) ? 'rd' : 'th';
2820
+ return number + output;
2821
+ }
2822
+ });
2823
+
2824
+ /* EMBED_LOCALES */
2825
+
2826
+ /************************************
2827
+ Exposing Moment
2828
+ ************************************/
2829
+
2830
+ function makeGlobal(shouldDeprecate) {
2831
+ /*global ender:false */
2832
+ if (typeof ender !== 'undefined') {
2833
+ return;
2834
+ }
2835
+ oldGlobalMoment = globalScope.moment;
2836
+ if (shouldDeprecate) {
2837
+ globalScope.moment = deprecate(
2838
+ 'Accessing Moment through the global scope is ' +
2839
+ 'deprecated, and will be removed in an upcoming ' +
2840
+ 'release.',
2841
+ moment);
2842
+ } else {
2843
+ globalScope.moment = moment;
2844
+ }
2845
+ }
2846
+
2847
+ // CommonJS module is defined
2848
+ if (hasModule) {
2849
+ module.exports = moment;
2850
+ } else if (typeof define === 'function' && define.amd) {
2851
+ define('moment', function (require, exports, module) {
2852
+ if (module.config && module.config() && module.config().noGlobal === true) {
2853
+ // release the global variable
2854
+ globalScope.moment = oldGlobalMoment;
2855
+ }
2856
+
2857
+ return moment;
2858
+ });
2859
+ makeGlobal(true);
2860
+ } else {
2861
+ makeGlobal();
2862
+ }
2863
+ }).call(this);
2864
+ //! moment-timezone.js
2865
+ //! version : 0.2.4
2866
+ //! author : Tim Wood
2867
+ //! license : MIT
2868
+ //! github.com/moment/moment-timezone
2869
+
2870
+ (function (root, factory) {
2871
+ "use strict";
2872
+
2873
+ /*global define*/
2874
+ if (typeof define === 'function' && define.amd) {
2875
+ define(['moment'], factory); // AMD
2876
+ } else if (typeof exports === 'object') {
2877
+ module.exports = factory(require('moment')); // Node
2878
+ } else {
2879
+ factory(root.moment); // Browser
2880
+ }
2881
+ }(this, function (moment) {
2882
+ "use strict";
2883
+
2884
+ // Do not load moment-timezone a second time.
2885
+ if (moment.tz !== undefined) { return moment; }
2886
+
2887
+ var VERSION = "0.2.4",
2888
+ zones = {},
2889
+ links = {},
2890
+
2891
+ momentVersion = moment.version.split('.'),
2892
+ major = +momentVersion[0],
2893
+ minor = +momentVersion[1];
2894
+
2895
+ // Moment.js version check
2896
+ if (major < 2 || (major === 2 && minor < 6)) {
2897
+ logError('Moment Timezone requires Moment.js >= 2.6.0. You are using Moment.js ' + moment.version + '. See momentjs.com');
2898
+ }
2899
+
2900
+ /************************************
2901
+ Unpacking
2902
+ ************************************/
2903
+
2904
+ function charCodeToInt(charCode) {
2905
+ if (charCode > 96) {
2906
+ return charCode - 87;
2907
+ } else if (charCode > 64) {
2908
+ return charCode - 29;
2909
+ }
2910
+ return charCode - 48;
2911
+ }
2912
+
2913
+ function unpackBase60(string) {
2914
+ var i = 0,
2915
+ parts = string.split('.'),
2916
+ whole = parts[0],
2917
+ fractional = parts[1] || '',
2918
+ multiplier = 1,
2919
+ num,
2920
+ out = 0,
2921
+ sign = 1;
2922
+
2923
+ // handle negative numbers
2924
+ if (string.charCodeAt(0) === 45) {
2925
+ i = 1;
2926
+ sign = -1;
2927
+ }
2928
+
2929
+ // handle digits before the decimal
2930
+ for (i; i < whole.length; i++) {
2931
+ num = charCodeToInt(whole.charCodeAt(i));
2932
+ out = 60 * out + num;
2933
+ }
2934
+
2935
+ // handle digits after the decimal
2936
+ for (i = 0; i < fractional.length; i++) {
2937
+ multiplier = multiplier / 60;
2938
+ num = charCodeToInt(fractional.charCodeAt(i));
2939
+ out += num * multiplier;
2940
+ }
2941
+
2942
+ return out * sign;
2943
+ }
2944
+
2945
+ function arrayToInt (array) {
2946
+ for (var i = 0; i < array.length; i++) {
2947
+ array[i] = unpackBase60(array[i]);
2948
+ }
2949
+ }
2950
+
2951
+ function intToUntil (array, length) {
2952
+ for (var i = 0; i < length; i++) {
2953
+ array[i] = Math.round((array[i - 1] || 0) + (array[i] * 60000)); // minutes to milliseconds
2954
+ }
2955
+
2956
+ array[length - 1] = Infinity;
2957
+ }
2958
+
2959
+ function mapIndices (source, indices) {
2960
+ var out = [], i;
2961
+
2962
+ for (i = 0; i < indices.length; i++) {
2963
+ out[i] = source[indices[i]];
2964
+ }
2965
+
2966
+ return out;
2967
+ }
2968
+
2969
+ function unpack (string) {
2970
+ var data = string.split('|'),
2971
+ offsets = data[2].split(' '),
2972
+ indices = data[3].split(''),
2973
+ untils = data[4].split(' ');
2974
+
2975
+ arrayToInt(offsets);
2976
+ arrayToInt(indices);
2977
+ arrayToInt(untils);
2978
+
2979
+ intToUntil(untils, indices.length);
2980
+
2981
+ return {
2982
+ name : data[0],
2983
+ abbrs : mapIndices(data[1].split(' '), indices),
2984
+ offsets : mapIndices(offsets, indices),
2985
+ untils : untils
2986
+ };
2987
+ }
2988
+
2989
+ /************************************
2990
+ Zone object
2991
+ ************************************/
2992
+
2993
+ function Zone (packedString) {
2994
+ if (packedString) {
2995
+ this._set(unpack(packedString));
2996
+ }
2997
+ }
2998
+
2999
+ Zone.prototype = {
3000
+ _set : function (unpacked) {
3001
+ this.name = unpacked.name;
3002
+ this.abbrs = unpacked.abbrs;
3003
+ this.untils = unpacked.untils;
3004
+ this.offsets = unpacked.offsets;
3005
+ },
3006
+
3007
+ _index : function (timestamp) {
3008
+ var target = +timestamp,
3009
+ untils = this.untils,
3010
+ i;
3011
+
3012
+ for (i = 0; i < untils.length; i++) {
3013
+ if (target < untils[i]) {
3014
+ return i;
3015
+ }
3016
+ }
3017
+ },
3018
+
3019
+ parse : function (timestamp) {
3020
+ var target = +timestamp,
3021
+ offsets = this.offsets,
3022
+ untils = this.untils,
3023
+ max = untils.length - 1,
3024
+ offset, offsetNext, offsetPrev, i;
3025
+
3026
+ for (i = 0; i < max; i++) {
3027
+ offset = offsets[i];
3028
+ offsetNext = offsets[i + 1];
3029
+ offsetPrev = offsets[i ? i - 1 : i];
3030
+
3031
+ if (offset < offsetNext && tz.moveAmbiguousForward) {
3032
+ offset = offsetNext;
3033
+ } else if (offset > offsetPrev && tz.moveInvalidForward) {
3034
+ offset = offsetPrev;
3035
+ }
3036
+
3037
+ if (target < untils[i] - (offset * 60000)) {
3038
+ return offsets[i];
3039
+ }
3040
+ }
3041
+
3042
+ return offsets[max];
3043
+ },
3044
+
3045
+ abbr : function (mom) {
3046
+ return this.abbrs[this._index(mom)];
3047
+ },
3048
+
3049
+ offset : function (mom) {
3050
+ return this.offsets[this._index(mom)];
3051
+ }
3052
+ };
3053
+
3054
+ /************************************
3055
+ Global Methods
3056
+ ************************************/
3057
+
3058
+ function normalizeName (name) {
3059
+ return (name || '').toLowerCase().replace(/\//g, '_');
3060
+ }
3061
+
3062
+ function addZone (packed) {
3063
+ var i, zone, zoneName;
3064
+
3065
+ if (typeof packed === "string") {
3066
+ packed = [packed];
3067
+ }
3068
+
3069
+ for (i = 0; i < packed.length; i++) {
3070
+ zone = new Zone(packed[i]);
3071
+ zoneName = normalizeName(zone.name);
3072
+ zones[zoneName] = zone;
3073
+ upgradeLinksToZones(zoneName);
3074
+ }
3075
+ }
3076
+
3077
+ function getZone (name) {
3078
+ return zones[normalizeName(name)] || null;
3079
+ }
3080
+
3081
+ function getNames () {
3082
+ var i, out = [];
3083
+
3084
+ for (i in zones) {
3085
+ if (zones.hasOwnProperty(i) && zones[i]) {
3086
+ out.push(zones[i].name);
3087
+ }
3088
+ }
3089
+
3090
+ return out.sort();
3091
+ }
3092
+
3093
+ function addLink (aliases) {
3094
+ var i, alias;
3095
+
3096
+ if (typeof aliases === "string") {
3097
+ aliases = [aliases];
3098
+ }
3099
+
3100
+ for (i = 0; i < aliases.length; i++) {
3101
+ alias = aliases[i].split('|');
3102
+ pushLink(alias[0], alias[1]);
3103
+ pushLink(alias[1], alias[0]);
3104
+ }
3105
+ }
3106
+
3107
+ function upgradeLinksToZones (zoneName) {
3108
+ if (!links[zoneName]) {
3109
+ return;
3110
+ }
3111
+
3112
+ var i,
3113
+ zone = zones[zoneName],
3114
+ linkNames = links[zoneName];
3115
+
3116
+ for (i = 0; i < linkNames.length; i++) {
3117
+ copyZoneWithName(zone, linkNames[i]);
3118
+ }
3119
+
3120
+ links[zoneName] = null;
3121
+ }
3122
+
3123
+ function copyZoneWithName (zone, name) {
3124
+ var linkZone = zones[normalizeName(name)] = new Zone();
3125
+ linkZone._set(zone);
3126
+ linkZone.name = name;
3127
+ }
3128
+
3129
+ function pushLink (zoneName, linkName) {
3130
+ zoneName = normalizeName(zoneName);
3131
+
3132
+ if (zones[zoneName]) {
3133
+ copyZoneWithName(zones[zoneName], linkName);
3134
+ } else {
3135
+ links[zoneName] = links[zoneName] || [];
3136
+ links[zoneName].push(linkName);
3137
+ }
3138
+ }
3139
+
3140
+ function loadData (data) {
3141
+ addZone(data.zones);
3142
+ addLink(data.links);
3143
+ tz.dataVersion = data.version;
3144
+ }
3145
+
3146
+ function zoneExists (name) {
3147
+ if (!zoneExists.didShowError) {
3148
+ zoneExists.didShowError = true;
3149
+ logError("moment.tz.zoneExists('" + name + "') has been deprecated in favor of !moment.tz.zone('" + name + "')");
3150
+ }
3151
+ return !!getZone(name);
3152
+ }
3153
+
3154
+ function needsOffset (m) {
3155
+ return !!(m._a && (m._tzm === undefined));
3156
+ }
3157
+
3158
+ function logError (message) {
3159
+ if (typeof console !== 'undefined' && typeof console.error === 'function') {
3160
+ console.error(message);
3161
+ }
3162
+ }
3163
+
3164
+ /************************************
3165
+ moment.tz namespace
3166
+ ************************************/
3167
+
3168
+ function tz () {
3169
+ var args = Array.prototype.slice.call(arguments, 0, -1),
3170
+ name = arguments[arguments.length - 1],
3171
+ zone = getZone(name),
3172
+ out = moment.utc.apply(null, args);
3173
+
3174
+ if (zone && needsOffset(out)) {
3175
+ out.add(zone.parse(out), 'minutes');
3176
+ }
3177
+
3178
+ out.tz(name);
3179
+
3180
+ return out;
3181
+ }
3182
+
3183
+ tz.version = VERSION;
3184
+ tz.dataVersion = '';
3185
+ tz._zones = zones;
3186
+ tz._links = links;
3187
+ tz.add = addZone;
3188
+ tz.link = addLink;
3189
+ tz.load = loadData;
3190
+ tz.zone = getZone;
3191
+ tz.zoneExists = zoneExists; // deprecated in 0.1.0
3192
+ tz.names = getNames;
3193
+ tz.Zone = Zone;
3194
+ tz.unpack = unpack;
3195
+ tz.unpackBase60 = unpackBase60;
3196
+ tz.needsOffset = needsOffset;
3197
+ tz.moveInvalidForward = true;
3198
+ tz.moveAmbiguousForward = false;
3199
+
3200
+ /************************************
3201
+ Interface with Moment.js
3202
+ ************************************/
3203
+
3204
+ var fn = moment.fn;
3205
+
3206
+ moment.tz = tz;
3207
+
3208
+ moment.updateOffset = function (mom, keepTime) {
3209
+ var offset;
3210
+ if (mom._z) {
3211
+ offset = mom._z.offset(mom);
3212
+ if (Math.abs(offset) < 16) {
3213
+ offset = offset / 60;
3214
+ }
3215
+ mom.zone(offset, keepTime);
3216
+ }
3217
+ };
3218
+
3219
+ fn.tz = function (name) {
3220
+ if (name) {
3221
+ this._z = getZone(name);
3222
+ if (this._z) {
3223
+ moment.updateOffset(this);
3224
+ } else {
3225
+ logError("Moment Timezone has no data for " + name + ". See http://momentjs.com/timezone/docs/#/data-loading/.");
3226
+ }
3227
+ return this;
3228
+ }
3229
+ if (this._z) { return this._z.name; }
3230
+ };
3231
+
3232
+ function abbrWrap (old) {
3233
+ return function () {
3234
+ if (this._z) { return this._z.abbr(this); }
3235
+ return old.call(this);
3236
+ };
3237
+ }
3238
+
3239
+ function resetZoneWrap (old) {
3240
+ return function () {
3241
+ this._z = null;
3242
+ return old.apply(this, arguments);
3243
+ };
3244
+ }
3245
+
3246
+ fn.zoneName = abbrWrap(fn.zoneName);
3247
+ fn.zoneAbbr = abbrWrap(fn.zoneAbbr);
3248
+ fn.utc = resetZoneWrap(fn.utc);
3249
+
3250
+ // Cloning a moment should include the _z property.
3251
+ var momentProperties = moment.momentProperties;
3252
+ if (Object.prototype.toString.call(momentProperties) === '[object Array]') {
3253
+ // moment 2.8.1+
3254
+ momentProperties.push('_z');
3255
+ momentProperties.push('_a');
3256
+ } else if (momentProperties) {
3257
+ // moment 2.7.0
3258
+ momentProperties._z = null;
3259
+ }
3260
+
3261
+ loadData({
3262
+ "version": "2014i",
3263
+ "zones": [
3264
+ "Africa/Abidjan|GMT|0|0|",
3265
+ "Africa/Addis_Ababa|EAT|-30|0|",
3266
+ "Africa/Algiers|CET|-10|0|",
3267
+ "Africa/Bangui|WAT|-10|0|",
3268
+ "Africa/Blantyre|CAT|-20|0|",
3269
+ "Africa/Cairo|EET EEST|-20 -30|0101010101010101010101010101010|1Cby0 Fb0 c10 8n0 8Nd0 gL0 e10 mn0 1o10 jz0 gN0 pb0 1qN0 dX0 e10 xz0 1o10 bb0 e10 An0 1o10 5z0 e10 FX0 1o10 2L0 e10 IL0 1C10 Lz0",
3270
+ "Africa/Casablanca|WET WEST|0 -10|01010101010101010101010101010101010101010|1Cco0 Db0 1zd0 Lz0 1Nf0 wM0 co0 go0 1o00 s00 dA0 vc0 11A0 A00 e00 y00 11A0 uo0 e00 DA0 11A0 rA0 e00 Jc0 WM0 m00 gM0 M00 WM0 jc0 e00 RA0 11A0 dA0 e00 Uo0 11A0 800 gM0 Xc0",
3271
+ "Africa/Ceuta|CET CEST|-10 -20|01010101010101010101010|1BWp0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00",
3272
+ "Africa/Johannesburg|SAST|-20|0|",
3273
+ "Africa/Tripoli|EET CET CEST|-20 -10 -20|0120|1IlA0 TA0 1o00",
3274
+ "Africa/Windhoek|WAST WAT|-20 -10|01010101010101010101010|1C1c0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 11B0",
3275
+ "America/Adak|HAST HADT|a0 90|01010101010101010101010|1BR00 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0",
3276
+ "America/Anchorage|AKST AKDT|90 80|01010101010101010101010|1BQX0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0",
3277
+ "America/Anguilla|AST|40|0|",
3278
+ "America/Araguaina|BRT BRST|30 20|010|1IdD0 Lz0",
3279
+ "America/Argentina/Buenos_Aires|ART|30|0|",
3280
+ "America/Asuncion|PYST PYT|30 40|01010101010101010101010|1C430 1a10 1fz0 1a10 1fz0 1cN0 17b0 1ip0 17b0 1ip0 17b0 1ip0 19X0 1fB0 19X0 1fB0 19X0 1ip0 17b0 1ip0 17b0 1ip0",
3281
+ "America/Atikokan|EST|50|0|",
3282
+ "America/Bahia|BRT BRST|30 20|010|1FJf0 Rb0",
3283
+ "America/Bahia_Banderas|MST CDT CST|70 50 60|01212121212121212121212|1C1l0 1nW0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0",
3284
+ "America/Belem|BRT|30|0|",
3285
+ "America/Belize|CST|60|0|",
3286
+ "America/Boa_Vista|AMT|40|0|",
3287
+ "America/Bogota|COT|50|0|",
3288
+ "America/Boise|MST MDT|70 60|01010101010101010101010|1BQV0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0",
3289
+ "America/Campo_Grande|AMST AMT|30 40|01010101010101010101010|1BIr0 1zd0 On0 1zd0 Rb0 1zd0 Lz0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 On0 1zd0 On0 1C10 Lz0 1C10 Lz0 1C10",
3290
+ "America/Cancun|CST CDT|60 50|01010101010101010101010|1C1k0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0",
3291
+ "America/Caracas|VET|4u|0|",
3292
+ "America/Cayenne|GFT|30|0|",
3293
+ "America/Chicago|CST CDT|60 50|01010101010101010101010|1BQU0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0",
3294
+ "America/Chihuahua|MST MDT|70 60|01010101010101010101010|1C1l0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0",
3295
+ "America/Creston|MST|70|0|",
3296
+ "America/Dawson|PST PDT|80 70|01010101010101010101010|1BQW0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0",
3297
+ "America/Detroit|EST EDT|50 40|01010101010101010101010|1BQT0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0",
3298
+ "America/Eirunepe|AMT ACT|40 50|01|1KLE0",
3299
+ "America/Glace_Bay|AST ADT|40 30|01010101010101010101010|1BQS0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0",
3300
+ "America/Godthab|WGT WGST|30 20|01010101010101010101010|1BWp0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00",
3301
+ "America/Goose_Bay|AST ADT|40 30|01010101010101010101010|1BQQ1 1zb0 Op0 1zcX Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0",
3302
+ "America/Grand_Turk|EST EDT AST|50 40 40|01010101012|1BQT0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0",
3303
+ "America/Guayaquil|ECT|50|0|",
3304
+ "America/Guyana|GYT|40|0|",
3305
+ "America/Havana|CST CDT|50 40|01010101010101010101010|1BQR0 1wo0 U00 1zc0 U00 1qM0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0",
3306
+ "America/La_Paz|BOT|40|0|",
3307
+ "America/Lima|PET|50|0|",
3308
+ "America/Metlakatla|PST|80|0|",
3309
+ "America/Miquelon|PMST PMDT|30 20|01010101010101010101010|1BQR0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0",
3310
+ "America/Montevideo|UYST UYT|20 30|01010101010101010101010|1BQQ0 1ld0 14n0 1ld0 14n0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 14n0 1ld0 14n0 1ld0 14n0 1o10 11z0 1o10 11z0 1o10",
3311
+ "America/Noronha|FNT|20|0|",
3312
+ "America/North_Dakota/Beulah|MST MDT CST CDT|70 60 60 50|01232323232323232323232|1BQV0 1zb0 Oo0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0",
3313
+ "America/Paramaribo|SRT|30|0|",
3314
+ "America/Port-au-Prince|EST EDT|50 40|0101010101010101010|1GI70 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0",
3315
+ "America/Santa_Isabel|PST PDT|80 70|01010101010101010101010|1C1m0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0",
3316
+ "America/Santiago|CLST CLT|30 40|01010101010101010101010|1C1f0 1fB0 1nX0 G10 1EL0 Op0 1zb0 Rd0 1wn0 Rd0 1wn0 Rd0 1wn0 Rd0 1wn0 Rd0 1zb0 Op0 1zb0 Rd0 1wn0 Rd0",
3317
+ "America/Sao_Paulo|BRST BRT|20 30|01010101010101010101010|1BIq0 1zd0 On0 1zd0 Rb0 1zd0 Lz0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 On0 1zd0 On0 1C10 Lz0 1C10 Lz0 1C10",
3318
+ "America/Scoresbysund|EGT EGST|10 0|01010101010101010101010|1BWp0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00",
3319
+ "America/St_Johns|NST NDT|3u 2u|01010101010101010101010|1BQPv 1zb0 Op0 1zcX Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0",
3320
+ "Antarctica/Casey|CAST AWST|-b0 -80|0101|1BN30 40P0 KL0",
3321
+ "Antarctica/Davis|DAVT DAVT|-50 -70|0101|1BPw0 3Wn0 KN0",
3322
+ "Antarctica/DumontDUrville|DDUT|-a0|0|",
3323
+ "Antarctica/Macquarie|AEDT MIST|-b0 -b0|01|1C140",
3324
+ "Antarctica/Mawson|MAWT|-50|0|",
3325
+ "Antarctica/McMurdo|NZDT NZST|-d0 -c0|01010101010101010101010|1C120 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00",
3326
+ "Antarctica/Rothera|ROTT|30|0|",
3327
+ "Antarctica/Syowa|SYOT|-30|0|",
3328
+ "Antarctica/Troll|UTC CEST|0 -20|01010101010101010101010|1BWp0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00",
3329
+ "Antarctica/Vostok|VOST|-60|0|",
3330
+ "Asia/Aden|AST|-30|0|",
3331
+ "Asia/Almaty|ALMT|-60|0|",
3332
+ "Asia/Amman|EET EEST|-20 -30|010101010101010101010|1BVy0 1qM0 11A0 1o00 11A0 4bX0 Dd0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0",
3333
+ "Asia/Anadyr|ANAT ANAST ANAT|-c0 -c0 -b0|0120|1BWe0 1qN0 WM0",
3334
+ "Asia/Aqtau|AQTT|-50|0|",
3335
+ "Asia/Ashgabat|TMT|-50|0|",
3336
+ "Asia/Baku|AZT AZST|-40 -50|01010101010101010101010|1BWo0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00",
3337
+ "Asia/Bangkok|ICT|-70|0|",
3338
+ "Asia/Beirut|EET EEST|-20 -30|01010101010101010101010|1BWm0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0",
3339
+ "Asia/Bishkek|KGT|-60|0|",
3340
+ "Asia/Brunei|BNT|-80|0|",
3341
+ "Asia/Calcutta|IST|-5u|0|",
3342
+ "Asia/Chita|YAKT YAKST YAKT IRKT|-90 -a0 -a0 -80|01023|1BWh0 1qM0 WM0 8Hz0",
3343
+ "Asia/Choibalsan|CHOT|-80|0|",
3344
+ "Asia/Chongqing|CST|-80|0|",
3345
+ "Asia/Dacca|BDT|-60|0|",
3346
+ "Asia/Damascus|EET EEST|-20 -30|01010101010101010101010|1C0m0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0",
3347
+ "Asia/Dili|TLT|-90|0|",
3348
+ "Asia/Dubai|GST|-40|0|",
3349
+ "Asia/Dushanbe|TJT|-50|0|",
3350
+ "Asia/Gaza|EET EEST|-20 -30|01010101010101010101010|1BVW1 SKX 1xd1 MKX 1AN0 1a00 1fA0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 19X0 1fB0 19X0 1fB0 19X0 1fB0 1cL0 1cN0 1cL0",
3351
+ "Asia/Hebron|EET EEST|-20 -30|0101010101010101010101010|1BVy0 Tb0 1xd1 MKX bB0 cn0 1cN0 1a00 1fA0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 19X0 1fB0 19X0 1fB0 19X0 1fB0 1cL0 1cN0 1cL0",
3352
+ "Asia/Hong_Kong|HKT|-80|0|",
3353
+ "Asia/Hovd|HOVT|-70|0|",
3354
+ "Asia/Irkutsk|IRKT IRKST IRKT|-80 -90 -90|01020|1BWi0 1qM0 WM0 8Hz0",
3355
+ "Asia/Istanbul|EET EEST|-20 -30|01010101010101010101010|1BWp0 1qM0 Xc0 1qo0 WM0 1qM0 11A0 1o00 1200 1nA0 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00",
3356
+ "Asia/Jakarta|WIB|-70|0|",
3357
+ "Asia/Jayapura|WIT|-90|0|",
3358
+ "Asia/Jerusalem|IST IDT|-20 -30|01010101010101010101010|1BVA0 17X0 1kp0 1dz0 1c10 1aL0 1eN0 1oL0 10N0 1oL0 10N0 1oL0 10N0 1rz0 W10 1rz0 W10 1rz0 10N0 1oL0 10N0 1oL0",
3359
+ "Asia/Kabul|AFT|-4u|0|",
3360
+ "Asia/Kamchatka|PETT PETST PETT|-c0 -c0 -b0|0120|1BWe0 1qN0 WM0",
3361
+ "Asia/Karachi|PKT|-50|0|",
3362
+ "Asia/Kashgar|XJT|-60|0|",
3363
+ "Asia/Kathmandu|NPT|-5J|0|",
3364
+ "Asia/Khandyga|VLAT VLAST VLAT YAKT YAKT|-a0 -b0 -b0 -a0 -90|010234|1BWg0 1qM0 WM0 17V0 7zD0",
3365
+ "Asia/Krasnoyarsk|KRAT KRAST KRAT|-70 -80 -80|01020|1BWj0 1qM0 WM0 8Hz0",
3366
+ "Asia/Kuala_Lumpur|MYT|-80|0|",
3367
+ "Asia/Magadan|MAGT MAGST MAGT MAGT|-b0 -c0 -c0 -a0|01023|1BWf0 1qM0 WM0 8Hz0",
3368
+ "Asia/Makassar|WITA|-80|0|",
3369
+ "Asia/Manila|PHT|-80|0|",
3370
+ "Asia/Nicosia|EET EEST|-20 -30|01010101010101010101010|1BWp0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00",
3371
+ "Asia/Novokuznetsk|KRAT NOVST NOVT NOVT|-70 -70 -60 -70|01230|1BWj0 1qN0 WM0 8Hz0",
3372
+ "Asia/Novosibirsk|NOVT NOVST NOVT|-60 -70 -70|01020|1BWk0 1qM0 WM0 8Hz0",
3373
+ "Asia/Omsk|OMST OMSST OMST|-60 -70 -70|01020|1BWk0 1qM0 WM0 8Hz0",
3374
+ "Asia/Oral|ORAT|-50|0|",
3375
+ "Asia/Pyongyang|KST|-90|0|",
3376
+ "Asia/Qyzylorda|QYZT|-60|0|",
3377
+ "Asia/Rangoon|MMT|-6u|0|",
3378
+ "Asia/Sakhalin|SAKT SAKST SAKT|-a0 -b0 -b0|01020|1BWg0 1qM0 WM0 8Hz0",
3379
+ "Asia/Samarkand|UZT|-50|0|",
3380
+ "Asia/Singapore|SGT|-80|0|",
3381
+ "Asia/Srednekolymsk|MAGT MAGST MAGT SRET|-b0 -c0 -c0 -b0|01023|1BWf0 1qM0 WM0 8Hz0",
3382
+ "Asia/Tbilisi|GET|-40|0|",
3383
+ "Asia/Tehran|IRST IRDT|-3u -4u|01010101010101010101010|1BTUu 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0",
3384
+ "Asia/Thimbu|BTT|-60|0|",
3385
+ "Asia/Tokyo|JST|-90|0|",
3386
+ "Asia/Ulaanbaatar|ULAT|-80|0|",
3387
+ "Asia/Ust-Nera|MAGT MAGST MAGT VLAT VLAT|-b0 -c0 -c0 -b0 -a0|010234|1BWf0 1qM0 WM0 17V0 7zD0",
3388
+ "Asia/Vladivostok|VLAT VLAST VLAT|-a0 -b0 -b0|01020|1BWg0 1qM0 WM0 8Hz0",
3389
+ "Asia/Yakutsk|YAKT YAKST YAKT|-90 -a0 -a0|01020|1BWh0 1qM0 WM0 8Hz0",
3390
+ "Asia/Yekaterinburg|YEKT YEKST YEKT|-50 -60 -60|01020|1BWl0 1qM0 WM0 8Hz0",
3391
+ "Asia/Yerevan|AMT AMST|-40 -50|01010|1BWm0 1qM0 WM0 1qM0",
3392
+ "Atlantic/Azores|AZOT AZOST|10 0|01010101010101010101010|1BWp0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00",
3393
+ "Atlantic/Canary|WET WEST|0 -10|01010101010101010101010|1BWp0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00",
3394
+ "Atlantic/Cape_Verde|CVT|10|0|",
3395
+ "Atlantic/South_Georgia|GST|20|0|",
3396
+ "Atlantic/Stanley|FKST FKT|30 40|010|1C6R0 U10",
3397
+ "Australia/ACT|AEDT AEST|-b0 -a0|01010101010101010101010|1C140 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0",
3398
+ "Australia/Adelaide|ACDT ACST|-au -9u|01010101010101010101010|1C14u 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0",
3399
+ "Australia/Brisbane|AEST|-a0|0|",
3400
+ "Australia/Darwin|ACST|-9u|0|",
3401
+ "Australia/Eucla|ACWST|-8J|0|",
3402
+ "Australia/LHI|LHDT LHST|-b0 -au|01010101010101010101010|1C130 1cMu 1cLu 1cMu 1cLu 1fAu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1fAu 1cLu 1cMu 1cLu 1cMu",
3403
+ "Australia/Perth|AWST|-80|0|",
3404
+ "Chile/EasterIsland|EASST EAST|50 60|01010101010101010101010|1C1f0 1fB0 1nX0 G10 1EL0 Op0 1zb0 Rd0 1wn0 Rd0 1wn0 Rd0 1wn0 Rd0 1wn0 Rd0 1zb0 Op0 1zb0 Rd0 1wn0 Rd0",
3405
+ "Eire|GMT IST|0 -10|01010101010101010101010|1BWp0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00",
3406
+ "Etc/GMT+1|GMT+1|10|0|",
3407
+ "Etc/GMT+10|GMT+10|a0|0|",
3408
+ "Etc/GMT+11|GMT+11|b0|0|",
3409
+ "Etc/GMT+12|GMT+12|c0|0|",
3410
+ "Etc/GMT+2|GMT+2|20|0|",
3411
+ "Etc/GMT+3|GMT+3|30|0|",
3412
+ "Etc/GMT+4|GMT+4|40|0|",
3413
+ "Etc/GMT+5|GMT+5|50|0|",
3414
+ "Etc/GMT+6|GMT+6|60|0|",
3415
+ "Etc/GMT+7|GMT+7|70|0|",
3416
+ "Etc/GMT+8|GMT+8|80|0|",
3417
+ "Etc/GMT+9|GMT+9|90|0|",
3418
+ "Etc/GMT-1|GMT-1|-10|0|",
3419
+ "Etc/GMT-10|GMT-10|-a0|0|",
3420
+ "Etc/GMT-11|GMT-11|-b0|0|",
3421
+ "Etc/GMT-12|GMT-12|-c0|0|",
3422
+ "Etc/GMT-13|GMT-13|-d0|0|",
3423
+ "Etc/GMT-14|GMT-14|-e0|0|",
3424
+ "Etc/GMT-2|GMT-2|-20|0|",
3425
+ "Etc/GMT-3|GMT-3|-30|0|",
3426
+ "Etc/GMT-4|GMT-4|-40|0|",
3427
+ "Etc/GMT-5|GMT-5|-50|0|",
3428
+ "Etc/GMT-6|GMT-6|-60|0|",
3429
+ "Etc/GMT-7|GMT-7|-70|0|",
3430
+ "Etc/GMT-8|GMT-8|-80|0|",
3431
+ "Etc/GMT-9|GMT-9|-90|0|",
3432
+ "Etc/UCT|UCT|0|0|",
3433
+ "Etc/UTC|UTC|0|0|",
3434
+ "Europe/Belfast|GMT BST|0 -10|01010101010101010101010|1BWp0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00",
3435
+ "Europe/Kaliningrad|EET EEST FET|-20 -30 -30|01020|1BWo0 1qM0 WM0 8Hz0",
3436
+ "Europe/Minsk|EET EEST FET MSK|-20 -30 -30 -30|01023|1BWo0 1qM0 WM0 8Hy0",
3437
+ "Europe/Moscow|MSK MSD MSK|-30 -40 -40|01020|1BWn0 1qM0 WM0 8Hz0",
3438
+ "Europe/Samara|SAMT SAMST SAMT|-40 -40 -30|0120|1BWm0 1qN0 WM0",
3439
+ "Europe/Simferopol|EET EEST MSK MSK|-20 -30 -40 -30|01010101023|1BWp0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11z0 1nW0",
3440
+ "Europe/Volgograd|MSK MSK|-30 -40|01010|1BWn0 1qM0 WM0 8Hz0",
3441
+ "HST|HST|a0|0|",
3442
+ "Indian/Chagos|IOT|-60|0|",
3443
+ "Indian/Christmas|CXT|-70|0|",
3444
+ "Indian/Cocos|CCT|-6u|0|",
3445
+ "Indian/Kerguelen|TFT|-50|0|",
3446
+ "Indian/Mahe|SCT|-40|0|",
3447
+ "Indian/Maldives|MVT|-50|0|",
3448
+ "Indian/Mauritius|MUT|-40|0|",
3449
+ "Indian/Reunion|RET|-40|0|",
3450
+ "Kwajalein|MHT|-c0|0|",
3451
+ "MET|MET MEST|-10 -20|01010101010101010101010|1BWp0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00",
3452
+ "NZ-CHAT|CHADT CHAST|-dJ -cJ|01010101010101010101010|1C120 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00",
3453
+ "Pacific/Apia|SST SDT WSDT WSST|b0 a0 -e0 -d0|01012323232323232323232|1Dbn0 1ff0 1a00 CI0 AQ0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00",
3454
+ "Pacific/Bougainville|PGT BST|-a0 -b0|01|1NwE0",
3455
+ "Pacific/Chuuk|CHUT|-a0|0|",
3456
+ "Pacific/Efate|VUT|-b0|0|",
3457
+ "Pacific/Enderbury|PHOT|-d0|0|",
3458
+ "Pacific/Fakaofo|TKT TKT|b0 -d0|01|1Gfn0",
3459
+ "Pacific/Fiji|FJST FJT|-d0 -c0|01010101010101010101010|1BWe0 1o00 Rc0 1wo0 Ao0 1Nc0 Ao0 1Q00 xz0 1SN0 uM0 1SM0 xA0 1SM0 uM0 1SM0 uM0 1SM0 uM0 1SM0 uM0 1SM0",
3460
+ "Pacific/Funafuti|TVT|-c0|0|",
3461
+ "Pacific/Galapagos|GALT|60|0|",
3462
+ "Pacific/Gambier|GAMT|90|0|",
3463
+ "Pacific/Guadalcanal|SBT|-b0|0|",
3464
+ "Pacific/Guam|ChST|-a0|0|",
3465
+ "Pacific/Kiritimati|LINT|-e0|0|",
3466
+ "Pacific/Kosrae|KOST|-b0|0|",
3467
+ "Pacific/Marquesas|MART|9u|0|",
3468
+ "Pacific/Midway|SST|b0|0|",
3469
+ "Pacific/Nauru|NRT|-c0|0|",
3470
+ "Pacific/Niue|NUT|b0|0|",
3471
+ "Pacific/Norfolk|NFT|-bu|0|",
3472
+ "Pacific/Noumea|NCT|-b0|0|",
3473
+ "Pacific/Palau|PWT|-90|0|",
3474
+ "Pacific/Pohnpei|PONT|-b0|0|",
3475
+ "Pacific/Port_Moresby|PGT|-a0|0|",
3476
+ "Pacific/Rarotonga|CKT|a0|0|",
3477
+ "Pacific/Tahiti|TAHT|a0|0|",
3478
+ "Pacific/Tarawa|GILT|-c0|0|",
3479
+ "Pacific/Tongatapu|TOT|-d0|0|",
3480
+ "Pacific/Wake|WAKT|-c0|0|",
3481
+ "Pacific/Wallis|WFT|-c0|0|"
3482
+ ],
3483
+ "links": [
3484
+ "Africa/Abidjan|Africa/Accra",
3485
+ "Africa/Abidjan|Africa/Bamako",
3486
+ "Africa/Abidjan|Africa/Banjul",
3487
+ "Africa/Abidjan|Africa/Bissau",
3488
+ "Africa/Abidjan|Africa/Conakry",
3489
+ "Africa/Abidjan|Africa/Dakar",
3490
+ "Africa/Abidjan|Africa/Freetown",
3491
+ "Africa/Abidjan|Africa/Lome",
3492
+ "Africa/Abidjan|Africa/Monrovia",
3493
+ "Africa/Abidjan|Africa/Nouakchott",
3494
+ "Africa/Abidjan|Africa/Ouagadougou",
3495
+ "Africa/Abidjan|Africa/Sao_Tome",
3496
+ "Africa/Abidjan|Africa/Timbuktu",
3497
+ "Africa/Abidjan|America/Danmarkshavn",
3498
+ "Africa/Abidjan|Atlantic/Reykjavik",
3499
+ "Africa/Abidjan|Atlantic/St_Helena",
3500
+ "Africa/Abidjan|Etc/GMT",
3501
+ "Africa/Abidjan|Etc/GMT+0",
3502
+ "Africa/Abidjan|Etc/GMT-0",
3503
+ "Africa/Abidjan|Etc/GMT0",
3504
+ "Africa/Abidjan|Etc/Greenwich",
3505
+ "Africa/Abidjan|GMT",
3506
+ "Africa/Abidjan|GMT+0",
3507
+ "Africa/Abidjan|GMT-0",
3508
+ "Africa/Abidjan|GMT0",
3509
+ "Africa/Abidjan|Greenwich",
3510
+ "Africa/Abidjan|Iceland",
3511
+ "Africa/Addis_Ababa|Africa/Asmara",
3512
+ "Africa/Addis_Ababa|Africa/Asmera",
3513
+ "Africa/Addis_Ababa|Africa/Dar_es_Salaam",
3514
+ "Africa/Addis_Ababa|Africa/Djibouti",
3515
+ "Africa/Addis_Ababa|Africa/Juba",
3516
+ "Africa/Addis_Ababa|Africa/Kampala",
3517
+ "Africa/Addis_Ababa|Africa/Khartoum",
3518
+ "Africa/Addis_Ababa|Africa/Mogadishu",
3519
+ "Africa/Addis_Ababa|Africa/Nairobi",
3520
+ "Africa/Addis_Ababa|Indian/Antananarivo",
3521
+ "Africa/Addis_Ababa|Indian/Comoro",
3522
+ "Africa/Addis_Ababa|Indian/Mayotte",
3523
+ "Africa/Algiers|Africa/Tunis",
3524
+ "Africa/Bangui|Africa/Brazzaville",
3525
+ "Africa/Bangui|Africa/Douala",
3526
+ "Africa/Bangui|Africa/Kinshasa",
3527
+ "Africa/Bangui|Africa/Lagos",
3528
+ "Africa/Bangui|Africa/Libreville",
3529
+ "Africa/Bangui|Africa/Luanda",
3530
+ "Africa/Bangui|Africa/Malabo",
3531
+ "Africa/Bangui|Africa/Ndjamena",
3532
+ "Africa/Bangui|Africa/Niamey",
3533
+ "Africa/Bangui|Africa/Porto-Novo",
3534
+ "Africa/Blantyre|Africa/Bujumbura",
3535
+ "Africa/Blantyre|Africa/Gaborone",
3536
+ "Africa/Blantyre|Africa/Harare",
3537
+ "Africa/Blantyre|Africa/Kigali",
3538
+ "Africa/Blantyre|Africa/Lubumbashi",
3539
+ "Africa/Blantyre|Africa/Lusaka",
3540
+ "Africa/Blantyre|Africa/Maputo",
3541
+ "Africa/Cairo|Egypt",
3542
+ "Africa/Casablanca|Africa/El_Aaiun",
3543
+ "Africa/Ceuta|Arctic/Longyearbyen",
3544
+ "Africa/Ceuta|Atlantic/Jan_Mayen",
3545
+ "Africa/Ceuta|CET",
3546
+ "Africa/Ceuta|Europe/Amsterdam",
3547
+ "Africa/Ceuta|Europe/Andorra",
3548
+ "Africa/Ceuta|Europe/Belgrade",
3549
+ "Africa/Ceuta|Europe/Berlin",
3550
+ "Africa/Ceuta|Europe/Bratislava",
3551
+ "Africa/Ceuta|Europe/Brussels",
3552
+ "Africa/Ceuta|Europe/Budapest",
3553
+ "Africa/Ceuta|Europe/Busingen",
3554
+ "Africa/Ceuta|Europe/Copenhagen",
3555
+ "Africa/Ceuta|Europe/Gibraltar",
3556
+ "Africa/Ceuta|Europe/Ljubljana",
3557
+ "Africa/Ceuta|Europe/Luxembourg",
3558
+ "Africa/Ceuta|Europe/Madrid",
3559
+ "Africa/Ceuta|Europe/Malta",
3560
+ "Africa/Ceuta|Europe/Monaco",
3561
+ "Africa/Ceuta|Europe/Oslo",
3562
+ "Africa/Ceuta|Europe/Paris",
3563
+ "Africa/Ceuta|Europe/Podgorica",
3564
+ "Africa/Ceuta|Europe/Prague",
3565
+ "Africa/Ceuta|Europe/Rome",
3566
+ "Africa/Ceuta|Europe/San_Marino",
3567
+ "Africa/Ceuta|Europe/Sarajevo",
3568
+ "Africa/Ceuta|Europe/Skopje",
3569
+ "Africa/Ceuta|Europe/Stockholm",
3570
+ "Africa/Ceuta|Europe/Tirane",
3571
+ "Africa/Ceuta|Europe/Vaduz",
3572
+ "Africa/Ceuta|Europe/Vatican",
3573
+ "Africa/Ceuta|Europe/Vienna",
3574
+ "Africa/Ceuta|Europe/Warsaw",
3575
+ "Africa/Ceuta|Europe/Zagreb",
3576
+ "Africa/Ceuta|Europe/Zurich",
3577
+ "Africa/Ceuta|Poland",
3578
+ "Africa/Johannesburg|Africa/Maseru",
3579
+ "Africa/Johannesburg|Africa/Mbabane",
3580
+ "Africa/Tripoli|Libya",
3581
+ "America/Adak|America/Atka",
3582
+ "America/Adak|US/Aleutian",
3583
+ "America/Anchorage|America/Juneau",
3584
+ "America/Anchorage|America/Nome",
3585
+ "America/Anchorage|America/Sitka",
3586
+ "America/Anchorage|America/Yakutat",
3587
+ "America/Anchorage|US/Alaska",
3588
+ "America/Anguilla|America/Antigua",
3589
+ "America/Anguilla|America/Aruba",
3590
+ "America/Anguilla|America/Barbados",
3591
+ "America/Anguilla|America/Blanc-Sablon",
3592
+ "America/Anguilla|America/Curacao",
3593
+ "America/Anguilla|America/Dominica",
3594
+ "America/Anguilla|America/Grenada",
3595
+ "America/Anguilla|America/Guadeloupe",
3596
+ "America/Anguilla|America/Kralendijk",
3597
+ "America/Anguilla|America/Lower_Princes",
3598
+ "America/Anguilla|America/Marigot",
3599
+ "America/Anguilla|America/Martinique",
3600
+ "America/Anguilla|America/Montserrat",
3601
+ "America/Anguilla|America/Port_of_Spain",
3602
+ "America/Anguilla|America/Puerto_Rico",
3603
+ "America/Anguilla|America/Santo_Domingo",
3604
+ "America/Anguilla|America/St_Barthelemy",
3605
+ "America/Anguilla|America/St_Kitts",
3606
+ "America/Anguilla|America/St_Lucia",
3607
+ "America/Anguilla|America/St_Thomas",
3608
+ "America/Anguilla|America/St_Vincent",
3609
+ "America/Anguilla|America/Tortola",
3610
+ "America/Anguilla|America/Virgin",
3611
+ "America/Argentina/Buenos_Aires|America/Argentina/Catamarca",
3612
+ "America/Argentina/Buenos_Aires|America/Argentina/ComodRivadavia",
3613
+ "America/Argentina/Buenos_Aires|America/Argentina/Cordoba",
3614
+ "America/Argentina/Buenos_Aires|America/Argentina/Jujuy",
3615
+ "America/Argentina/Buenos_Aires|America/Argentina/La_Rioja",
3616
+ "America/Argentina/Buenos_Aires|America/Argentina/Mendoza",
3617
+ "America/Argentina/Buenos_Aires|America/Argentina/Rio_Gallegos",
3618
+ "America/Argentina/Buenos_Aires|America/Argentina/Salta",
3619
+ "America/Argentina/Buenos_Aires|America/Argentina/San_Juan",
3620
+ "America/Argentina/Buenos_Aires|America/Argentina/San_Luis",
3621
+ "America/Argentina/Buenos_Aires|America/Argentina/Tucuman",
3622
+ "America/Argentina/Buenos_Aires|America/Argentina/Ushuaia",
3623
+ "America/Argentina/Buenos_Aires|America/Buenos_Aires",
3624
+ "America/Argentina/Buenos_Aires|America/Catamarca",
3625
+ "America/Argentina/Buenos_Aires|America/Cordoba",
3626
+ "America/Argentina/Buenos_Aires|America/Jujuy",
3627
+ "America/Argentina/Buenos_Aires|America/Mendoza",
3628
+ "America/Argentina/Buenos_Aires|America/Rosario",
3629
+ "America/Atikokan|America/Cayman",
3630
+ "America/Atikokan|America/Coral_Harbour",
3631
+ "America/Atikokan|America/Jamaica",
3632
+ "America/Atikokan|America/Panama",
3633
+ "America/Atikokan|EST",
3634
+ "America/Atikokan|Jamaica",
3635
+ "America/Belem|America/Fortaleza",
3636
+ "America/Belem|America/Maceio",
3637
+ "America/Belem|America/Recife",
3638
+ "America/Belem|America/Santarem",
3639
+ "America/Belize|America/Costa_Rica",
3640
+ "America/Belize|America/El_Salvador",
3641
+ "America/Belize|America/Guatemala",
3642
+ "America/Belize|America/Managua",
3643
+ "America/Belize|America/Regina",
3644
+ "America/Belize|America/Swift_Current",
3645
+ "America/Belize|America/Tegucigalpa",
3646
+ "America/Belize|Canada/East-Saskatchewan",
3647
+ "America/Belize|Canada/Saskatchewan",
3648
+ "America/Boa_Vista|America/Manaus",
3649
+ "America/Boa_Vista|America/Porto_Velho",
3650
+ "America/Boa_Vista|Brazil/West",
3651
+ "America/Boise|America/Cambridge_Bay",
3652
+ "America/Boise|America/Denver",
3653
+ "America/Boise|America/Edmonton",
3654
+ "America/Boise|America/Inuvik",
3655
+ "America/Boise|America/Ojinaga",
3656
+ "America/Boise|America/Shiprock",
3657
+ "America/Boise|America/Yellowknife",
3658
+ "America/Boise|Canada/Mountain",
3659
+ "America/Boise|MST7MDT",
3660
+ "America/Boise|Navajo",
3661
+ "America/Boise|US/Mountain",
3662
+ "America/Campo_Grande|America/Cuiaba",
3663
+ "America/Cancun|America/Merida",
3664
+ "America/Cancun|America/Mexico_City",
3665
+ "America/Cancun|America/Monterrey",
3666
+ "America/Cancun|Mexico/General",
3667
+ "America/Chicago|America/Indiana/Knox",
3668
+ "America/Chicago|America/Indiana/Tell_City",
3669
+ "America/Chicago|America/Knox_IN",
3670
+ "America/Chicago|America/Matamoros",
3671
+ "America/Chicago|America/Menominee",
3672
+ "America/Chicago|America/North_Dakota/Center",
3673
+ "America/Chicago|America/North_Dakota/New_Salem",
3674
+ "America/Chicago|America/Rainy_River",
3675
+ "America/Chicago|America/Rankin_Inlet",
3676
+ "America/Chicago|America/Resolute",
3677
+ "America/Chicago|America/Winnipeg",
3678
+ "America/Chicago|CST6CDT",
3679
+ "America/Chicago|Canada/Central",
3680
+ "America/Chicago|US/Central",
3681
+ "America/Chicago|US/Indiana-Starke",
3682
+ "America/Chihuahua|America/Mazatlan",
3683
+ "America/Chihuahua|Mexico/BajaSur",
3684
+ "America/Creston|America/Dawson_Creek",
3685
+ "America/Creston|America/Hermosillo",
3686
+ "America/Creston|America/Phoenix",
3687
+ "America/Creston|MST",
3688
+ "America/Creston|US/Arizona",
3689
+ "America/Dawson|America/Ensenada",
3690
+ "America/Dawson|America/Los_Angeles",
3691
+ "America/Dawson|America/Tijuana",
3692
+ "America/Dawson|America/Vancouver",
3693
+ "America/Dawson|America/Whitehorse",
3694
+ "America/Dawson|Canada/Pacific",
3695
+ "America/Dawson|Canada/Yukon",
3696
+ "America/Dawson|Mexico/BajaNorte",
3697
+ "America/Dawson|PST8PDT",
3698
+ "America/Dawson|US/Pacific",
3699
+ "America/Dawson|US/Pacific-New",
3700
+ "America/Detroit|America/Fort_Wayne",
3701
+ "America/Detroit|America/Indiana/Indianapolis",
3702
+ "America/Detroit|America/Indiana/Marengo",
3703
+ "America/Detroit|America/Indiana/Petersburg",
3704
+ "America/Detroit|America/Indiana/Vevay",
3705
+ "America/Detroit|America/Indiana/Vincennes",
3706
+ "America/Detroit|America/Indiana/Winamac",
3707
+ "America/Detroit|America/Indianapolis",
3708
+ "America/Detroit|America/Iqaluit",
3709
+ "America/Detroit|America/Kentucky/Louisville",
3710
+ "America/Detroit|America/Kentucky/Monticello",
3711
+ "America/Detroit|America/Louisville",
3712
+ "America/Detroit|America/Montreal",
3713
+ "America/Detroit|America/Nassau",
3714
+ "America/Detroit|America/New_York",
3715
+ "America/Detroit|America/Nipigon",
3716
+ "America/Detroit|America/Pangnirtung",
3717
+ "America/Detroit|America/Thunder_Bay",
3718
+ "America/Detroit|America/Toronto",
3719
+ "America/Detroit|Canada/Eastern",
3720
+ "America/Detroit|EST5EDT",
3721
+ "America/Detroit|US/East-Indiana",
3722
+ "America/Detroit|US/Eastern",
3723
+ "America/Detroit|US/Michigan",
3724
+ "America/Eirunepe|America/Porto_Acre",
3725
+ "America/Eirunepe|America/Rio_Branco",
3726
+ "America/Eirunepe|Brazil/Acre",
3727
+ "America/Glace_Bay|America/Halifax",
3728
+ "America/Glace_Bay|America/Moncton",
3729
+ "America/Glace_Bay|America/Thule",
3730
+ "America/Glace_Bay|Atlantic/Bermuda",
3731
+ "America/Glace_Bay|Canada/Atlantic",
3732
+ "America/Havana|Cuba",
3733
+ "America/Metlakatla|Pacific/Pitcairn",
3734
+ "America/Noronha|Brazil/DeNoronha",
3735
+ "America/Santiago|Antarctica/Palmer",
3736
+ "America/Santiago|Chile/Continental",
3737
+ "America/Sao_Paulo|Brazil/East",
3738
+ "America/St_Johns|Canada/Newfoundland",
3739
+ "Antarctica/McMurdo|Antarctica/South_Pole",
3740
+ "Antarctica/McMurdo|NZ",
3741
+ "Antarctica/McMurdo|Pacific/Auckland",
3742
+ "Asia/Aden|Asia/Baghdad",
3743
+ "Asia/Aden|Asia/Bahrain",
3744
+ "Asia/Aden|Asia/Kuwait",
3745
+ "Asia/Aden|Asia/Qatar",
3746
+ "Asia/Aden|Asia/Riyadh",
3747
+ "Asia/Aqtau|Asia/Aqtobe",
3748
+ "Asia/Ashgabat|Asia/Ashkhabad",
3749
+ "Asia/Bangkok|Asia/Ho_Chi_Minh",
3750
+ "Asia/Bangkok|Asia/Phnom_Penh",
3751
+ "Asia/Bangkok|Asia/Saigon",
3752
+ "Asia/Bangkok|Asia/Vientiane",
3753
+ "Asia/Calcutta|Asia/Colombo",
3754
+ "Asia/Calcutta|Asia/Kolkata",
3755
+ "Asia/Chongqing|Asia/Chungking",
3756
+ "Asia/Chongqing|Asia/Harbin",
3757
+ "Asia/Chongqing|Asia/Macao",
3758
+ "Asia/Chongqing|Asia/Macau",
3759
+ "Asia/Chongqing|Asia/Shanghai",
3760
+ "Asia/Chongqing|Asia/Taipei",
3761
+ "Asia/Chongqing|PRC",
3762
+ "Asia/Chongqing|ROC",
3763
+ "Asia/Dacca|Asia/Dhaka",
3764
+ "Asia/Dubai|Asia/Muscat",
3765
+ "Asia/Hong_Kong|Hongkong",
3766
+ "Asia/Istanbul|Europe/Istanbul",
3767
+ "Asia/Istanbul|Turkey",
3768
+ "Asia/Jakarta|Asia/Pontianak",
3769
+ "Asia/Jerusalem|Asia/Tel_Aviv",
3770
+ "Asia/Jerusalem|Israel",
3771
+ "Asia/Kashgar|Asia/Urumqi",
3772
+ "Asia/Kathmandu|Asia/Katmandu",
3773
+ "Asia/Kuala_Lumpur|Asia/Kuching",
3774
+ "Asia/Makassar|Asia/Ujung_Pandang",
3775
+ "Asia/Nicosia|EET",
3776
+ "Asia/Nicosia|Europe/Athens",
3777
+ "Asia/Nicosia|Europe/Bucharest",
3778
+ "Asia/Nicosia|Europe/Chisinau",
3779
+ "Asia/Nicosia|Europe/Helsinki",
3780
+ "Asia/Nicosia|Europe/Kiev",
3781
+ "Asia/Nicosia|Europe/Mariehamn",
3782
+ "Asia/Nicosia|Europe/Nicosia",
3783
+ "Asia/Nicosia|Europe/Riga",
3784
+ "Asia/Nicosia|Europe/Sofia",
3785
+ "Asia/Nicosia|Europe/Tallinn",
3786
+ "Asia/Nicosia|Europe/Tiraspol",
3787
+ "Asia/Nicosia|Europe/Uzhgorod",
3788
+ "Asia/Nicosia|Europe/Vilnius",
3789
+ "Asia/Nicosia|Europe/Zaporozhye",
3790
+ "Asia/Pyongyang|Asia/Seoul",
3791
+ "Asia/Pyongyang|ROK",
3792
+ "Asia/Samarkand|Asia/Tashkent",
3793
+ "Asia/Singapore|Singapore",
3794
+ "Asia/Tehran|Iran",
3795
+ "Asia/Thimbu|Asia/Thimphu",
3796
+ "Asia/Tokyo|Japan",
3797
+ "Asia/Ulaanbaatar|Asia/Ulan_Bator",
3798
+ "Atlantic/Canary|Atlantic/Faeroe",
3799
+ "Atlantic/Canary|Atlantic/Faroe",
3800
+ "Atlantic/Canary|Atlantic/Madeira",
3801
+ "Atlantic/Canary|Europe/Lisbon",
3802
+ "Atlantic/Canary|Portugal",
3803
+ "Atlantic/Canary|WET",
3804
+ "Australia/ACT|Australia/Canberra",
3805
+ "Australia/ACT|Australia/Currie",
3806
+ "Australia/ACT|Australia/Hobart",
3807
+ "Australia/ACT|Australia/Melbourne",
3808
+ "Australia/ACT|Australia/NSW",
3809
+ "Australia/ACT|Australia/Sydney",
3810
+ "Australia/ACT|Australia/Tasmania",
3811
+ "Australia/ACT|Australia/Victoria",
3812
+ "Australia/Adelaide|Australia/Broken_Hill",
3813
+ "Australia/Adelaide|Australia/South",
3814
+ "Australia/Adelaide|Australia/Yancowinna",
3815
+ "Australia/Brisbane|Australia/Lindeman",
3816
+ "Australia/Brisbane|Australia/Queensland",
3817
+ "Australia/Darwin|Australia/North",
3818
+ "Australia/LHI|Australia/Lord_Howe",
3819
+ "Australia/Perth|Australia/West",
3820
+ "Chile/EasterIsland|Pacific/Easter",
3821
+ "Eire|Europe/Dublin",
3822
+ "Etc/UCT|UCT",
3823
+ "Etc/UTC|Etc/Universal",
3824
+ "Etc/UTC|Etc/Zulu",
3825
+ "Etc/UTC|UTC",
3826
+ "Etc/UTC|Universal",
3827
+ "Etc/UTC|Zulu",
3828
+ "Europe/Belfast|Europe/Guernsey",
3829
+ "Europe/Belfast|Europe/Isle_of_Man",
3830
+ "Europe/Belfast|Europe/Jersey",
3831
+ "Europe/Belfast|Europe/London",
3832
+ "Europe/Belfast|GB",
3833
+ "Europe/Belfast|GB-Eire",
3834
+ "Europe/Moscow|W-SU",
3835
+ "HST|Pacific/Honolulu",
3836
+ "HST|Pacific/Johnston",
3837
+ "HST|US/Hawaii",
3838
+ "Kwajalein|Pacific/Kwajalein",
3839
+ "Kwajalein|Pacific/Majuro",
3840
+ "NZ-CHAT|Pacific/Chatham",
3841
+ "Pacific/Chuuk|Pacific/Truk",
3842
+ "Pacific/Chuuk|Pacific/Yap",
3843
+ "Pacific/Guam|Pacific/Saipan",
3844
+ "Pacific/Midway|Pacific/Pago_Pago",
3845
+ "Pacific/Midway|Pacific/Samoa",
3846
+ "Pacific/Midway|US/Samoa",
3847
+ "Pacific/Pohnpei|Pacific/Ponape"
3848
+ ]
3849
+ });
3850
+
3851
+
3852
+ return moment;
3853
+ }));
3854
+
3855
+ (function($){
3856
+
3857
+ var Timezone = {
3858
+ init : function(cities, formatName){
3859
+ this.cities = [];
3860
+ this.formatName = formatName;
3861
+
3862
+ for(var key in cities) {
3863
+ this.cities.push({
3864
+ name: cities[key],
3865
+ offset: moment.tz(cities[key]).format('Z')
3866
+ });
3867
+ }
3868
+
3869
+ this.cities.sort(function(a, b){
3870
+ return parseInt(a.offset.replace(":", ""), 10) - parseInt(b.offset.replace(":", ""), 10);
3871
+ });
3872
+
3873
+ this.html = this.getHTMLOptions();
3874
+ this.currentTimezone = this.getCurrentTimezoneKey();
3875
+ },
3876
+ getHTMLOptions : function(){
3877
+ var html = '';
3878
+ var offset = 0;
3879
+ var i, c = this.cities.length, city;
3880
+
3881
+ for(i = 0; i < c; i++) {
3882
+ city = this.cities[i];
3883
+ html += '<option data-offset="' + city.offset + '" value="'+ city.name +'">(GMT ' + city.offset + ') ' + this.formatName(city.name) +'</option>';
3884
+ }
3885
+
3886
+ return html;
3887
+ },
3888
+ addNames : function(select){
3889
+ return $(select).empty().append($(this.html));
3890
+ },
3891
+ selectValue : function(select, value){
3892
+ value = value || this.currentTimezone;
3893
+
3894
+ var match = $(select).find('option[data-offset="' + value + '"]');
3895
+
3896
+ if (match.length){
3897
+ $(select).val(match.val());
3898
+ }
3899
+
3900
+ return $(select);
3901
+ },
3902
+ getCurrentTimezoneKey : function(){
3903
+ return moment().format('Z');
3904
+ },
3905
+ getCurrentOffset : function(){
3906
+ return parseInt(this.currentTimezone, 10);
3907
+ }
3908
+ };
3909
+
3910
+ $.fn.timezones = function(opts) {
3911
+
3912
+ if(typeof opts === "string") {
3913
+ return Timezone[opts].apply(Timezone, Array.prototype.slice.call(arguments));
3914
+ }
3915
+
3916
+ opts = $.extend({}, $.fn.timezones.defaults, opts);
3917
+ if (opts.tz.zones.length !== 0) {
3918
+ moment.tz.load(opts.tz);
3919
+ }
3920
+
3921
+ if(!opts.formatName || typeof opts.formatName !== 'function') {
3922
+ opts.formatName = function(str) {
3923
+ return str;
3924
+ };
3925
+ }
3926
+
3927
+ Timezone.init(moment.tz.names(), opts.formatName);
3928
+
3929
+ return this.each(function(){
3930
+ Timezone.addNames(this);
3931
+ Timezone.selectValue(this);
3932
+ return this;
3933
+ });
3934
+ };
3935
+
3936
+ $.fn.timezones.defaults = {
3937
+ tz: {
3938
+ zones: []
3939
+ }
3940
+ };
3941
+ })(jQuery);