Skip to content

Commit

Permalink
Merge pull request #6 from ndaidong/develop
Browse files Browse the repository at this point in the history
v5.1.2
  • Loading branch information
ndaidong committed Apr 29, 2016
2 parents 85af06e + 239f4f8 commit ea026e5
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
language: node_js
node_js:
- "6.0.0"
- "5.11.0"
- "5.9"
- "5.0"
- "4.2"
- "4.0"
before_script:
- export TZ=Etc/GMT-7
after_success:
Expand Down
2 changes: 1 addition & 1 deletion dist/bella.min.js

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "5.1.1",
"version": "5.1.2",
"name": "bellajs",
"description": "A useful helper for any javascript program",
"homepage": "http://techpush.net",
Expand Down
2 changes: 1 addition & 1 deletion src/bella.js
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@
let t = new Date().getTimezoneOffset();
let z = Math.abs(t / 60);
let sign = t < 0 ? '+' : '-';
return [ 'GMT', sign, leftPad(z, 2) ].join('');
return [ 'GMT', sign, leftPad(z, 4) ].join('');
})();

var format = (output, input) => {
Expand Down
6 changes: 3 additions & 3 deletions test/specs/date/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ test('Testing .date.format(String pattern, Number timestamp) method:', (assert)
{ ouput: 'M j, Y h:i:s A', expectation: 'Feb 18, 2016 03:28:20 PM' },
{ ouput: null, expectation: 'Thu, Feb 18, 2016 03:28:20 PM' },
{ ouput: 'l, j F Y h:i:s a', expectation: 'Thursday, 18 February 2016 03:28:20 pm' },
{ ouput: 'w D G O', expectation: '4 Thu 15 GMT+07' },
{ ouput: 'w D G O', expectation: '4 Thu 15 GMT+0007' },
{ ouput: 'm/d/y', expectation: '02/18/16' },
{ ouput: 'm/d/y t', expectation: '02/18/16 29' },
{ ouput: 'M jS, Y', expectation: 'Feb 18th, 2016' },
Expand Down Expand Up @@ -139,14 +139,14 @@ test('Testing .date.utc(Number timestamp) method:', (assert) => {
test('Testing .date.local(Number timestamp) method:', (assert) => {
let t = 1455784100000;
let r = bella.date.local(t);
let e = 'Thu, 18 Feb 2016 15:28:20 GMT+07';
let e = 'Thu, 18 Feb 2016 15:28:20 GMT+0007';
assert.deepEqual(r, e, `bella.date.local(${t}) must return ${e}`);
assert.end();
});

// .date.format
test('Testing .date.strtotime(String Datetime) method:', (assert) => {
let s = 'Thu, 18 Feb 2016 15:28:20 GMT+07';
let s = 'Thu, 18 Feb 2016 15:28:20 GMT+0007';
let r = bella.date.strtotime(s);
let e = 1455808880000;
assert.deepEqual(r, e, `bella.date.strtotime('${s}') must return ${e}`);
Expand Down

0 comments on commit ea026e5

Please sign in to comment.