From 804db8e0b1b8ee640714547d3efc6fd22ea08ff4 Mon Sep 17 00:00:00 2001 From: Sam Shepherd Date: Wed, 22 Feb 2017 13:43:44 -0600 Subject: [PATCH] v3.1.0 --- CHANGELOG.md | 20 ++++++++++++++++++++ package.json | 2 +- spec/specs.js | 2 -- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64bc1d9..aac6a78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,25 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [3.1.0] - 2017-02-22 + +### Changes +#### Added `Utils.hasTZOffset()` +Usage: +``` js +Utils.hasTZOffset('2017-02-22 13:26 -06:00') // true +``` + +#### Added `Utils.applyTzOffset()` +This doesn't make JS dates timezone aware. It 'pretends' to by shifting the date. +Usage: +``` js +Utils.applyTzOffset(new Date('2017-02-22'), 'America/Chicago'); // Returns a date shifted to the timezone specified +``` + +### Fixes +- Worked around a bug in SugarDate when sometimes `today at 3pm` would get parsed as the next day at 3pm. + ## [3.0.2] - 2017-02-13 ### Fixes @@ -156,6 +175,7 @@ backoff.attemptAsync(operation, options).then(res => { ### Added - Initial release. +[3.1.0]: https://github.com/flowxo/flowxo-utils/compare/v3.0.2...v3.1.0 [3.0.2]: https://github.com/flowxo/flowxo-utils/compare/v3.0.1...v3.0.2 [3.0.1]: https://github.com/flowxo/flowxo-utils/compare/v3.0.0...v3.0.1 [3.0.0]: https://github.com/flowxo/flowxo-utils/compare/v2.1.0...v3.0.0 diff --git a/package.json b/package.json index 0af90e8..094a0ea 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "flowxo-utils", - "version": "3.0.2", + "version": "3.1.0", "description": "Common utilities for Flow XO.", "main": "lib/index.js", "scripts": { diff --git a/spec/specs.js b/spec/specs.js index 195ed42..f778b23 100644 --- a/spec/specs.js +++ b/spec/specs.js @@ -898,7 +898,6 @@ describe('Utils', function() { expect(d.moment.toDate()).toEqual(expectedMoment.toDate()); // .parsed is expected to be in the timezone of the host machine. - // TODO: Get this working! expect(d.parsed).toEqual(expectedParsed.toDate()); } [ @@ -920,7 +919,6 @@ describe('Utils', function() { var expectedMoment = moment().tz(timezone).add(5, 'minutes'); expectDatesToBeClose(d.moment.toDate(), expectedMoment.toDate()); - // TODO: Get this working! var expectedParsed = moment().add(5, 'minutes'); expectDatesToBeClose(d.parsed, expectedParsed.toDate()); }