Skip to content

Commit

Permalink
Version 0.3.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
timrwood committed Jan 13, 2015
1 parent 85149f6 commit 6be7fee
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 21 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "moment-timezone",
"description" : "Parse and display moments in any timezone.",
"version": "0.2.5",
"version": "0.3.0",
"main": "builds/moment-timezone-with-data-2010-2020.js",
"dependencies" : {
"moment" : ">= 2.6.0"
Expand Down
27 changes: 22 additions & 5 deletions builds/moment-timezone-with-data-2010-2020.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! moment-timezone.js
//! version : 0.2.5
//! version : 0.3.0
//! author : Tim Wood
//! license : MIT
//! github.com/moment/moment-timezone
Expand All @@ -21,7 +21,7 @@
// Do not load moment-timezone a second time.
if (moment.tz !== undefined) { return moment; }

var VERSION = "0.2.5",
var VERSION = "0.3.0",
zones = {},
links = {},

Expand Down Expand Up @@ -302,13 +302,13 @@
moment.tz namespace
************************************/

function tz () {
function tz (input) {
var args = Array.prototype.slice.call(arguments, 0, -1),
name = arguments[arguments.length - 1],
zone = getZone(name),
out = moment.utc.apply(null, args);

if (zone && needsOffset(out)) {
if (zone && !moment.isMoment(input) && needsOffset(out)) {
out.add(zone.parse(out), 'minutes');
}

Expand Down Expand Up @@ -342,14 +342,23 @@

moment.tz = tz;

moment.defaultZone = null;

moment.updateOffset = function (mom, keepTime) {
var offset;
if (mom._z === undefined) {
mom._z = moment.defaultZone;
}
if (mom._z) {
offset = mom._z.offset(mom);
if (Math.abs(offset) < 16) {
offset = offset / 60;
}
mom.zone(offset, keepTime);
if (mom.utcOffset !== undefined) {
mom.utcOffset(-offset, keepTime);
} else {
mom.zone(offset, keepTime);
}
}
};

Expand Down Expand Up @@ -384,6 +393,14 @@
fn.zoneAbbr = abbrWrap(fn.zoneAbbr);
fn.utc = resetZoneWrap(fn.utc);

moment.tz.setDefault = function(name) {
if (major < 2 || (major === 2 && minor < 9)) {
logError('Moment Timezone setDefault() requires Moment.js >= 2.9.0. You are using Moment.js ' + moment.version + '.');
}
moment.defaultZone = name ? getZone(name) : null;
return moment;
};

// Cloning a moment should include the _z property.
var momentProperties = moment.momentProperties;
if (Object.prototype.toString.call(momentProperties) === '[object Array]') {
Expand Down
4 changes: 2 additions & 2 deletions builds/moment-timezone-with-data-2010-2020.min.js

Large diffs are not rendered by default.

27 changes: 22 additions & 5 deletions builds/moment-timezone-with-data.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions builds/moment-timezone-with-data.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions builds/moment-timezone.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
### `0.3.0` _2015-01-13_

* Added the ability to set a default timezone for all new moments. []()
* Added country data to the `meta/*.json` files. []()
* Fixed a bug when passing a moment with an offset to `moment.tz`. []()
* Fixed a deprecation in moment core, changing `moment#zone` to `moment#utcOffset`. []()

### `0.2.5` _2014-11-12_
* Updated data to IANA TZDB `2014j`. [#151](https://github.com/moment/moment-timezone/pull/151)

Expand Down
2 changes: 1 addition & 1 deletion moment-timezone-utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! moment-timezone-utils.js
//! version : 0.2.5
//! version : 0.3.0
//! author : Tim Wood
//! license : MIT
//! github.com/moment/moment-timezone
Expand Down
4 changes: 2 additions & 2 deletions moment-timezone.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! moment-timezone.js
//! version : 0.2.5
//! version : 0.3.0
//! author : Tim Wood
//! license : MIT
//! github.com/moment/moment-timezone
Expand All @@ -21,7 +21,7 @@
// Do not load moment-timezone a second time.
if (moment.tz !== undefined) { return moment; }

var VERSION = "0.2.5",
var VERSION = "0.3.0",
zones = {},
links = {},

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "moment-timezone",
"version": "0.2.5",
"version": "0.3.0",
"description": "Parse and display moments in any timezone.",
"homepage": "http://momentjs.com/timezone/",
"author": "Tim Wood <washwithcare@gmail.com> (http://timwoodcreates.com/)",
Expand Down

0 comments on commit 6be7fee

Please sign in to comment.