Skip to content

Commit aa15ac2

Browse files
author
Marco
committed
dependencies for moment und jstz added
1 parent 9379374 commit aa15ac2

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

bower.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
"devDependencies": {
2121
"jquery": "^2.2.4",
2222
"cryptojslib": "^3.1.2",
23-
"brein-util": "git+https://github.com/breinify/brein-javascript.git"
23+
"brein-util": "git+https://github.com/breinify/brein-javascript.git",
24+
"jstz": "https://github.com/bower-packages/bower-jstz.git#1.0.5",
25+
"moment": "https://github.com/moment/moment.git#"
2426
}
2527
}

gruntfile.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,9 @@ module.exports = function (grunt) {
205205
'components/sha256.js',
206206
'components/hmac.js'
207207
]
208-
}
208+
},
209+
'moment': {'main': 'moment.js'},
210+
'jstz': {'main': 'jstz.js'}
209211
}
210212
},
211213
dest: 'target/dep'
@@ -218,7 +220,9 @@ module.exports = function (grunt) {
218220
overrides: {
219221
'brein-util': {'main': 'grunt/default-layout/**/*'},
220222
'cryptojslib': {'ignore': true},
221-
'jquery': {'ignore': true}
223+
'jquery': {'ignore': true},
224+
'moment': {'ignore': true},
225+
'jstz': {'ignore': true}
222226
}
223227
},
224228
base: bowerPaths.bowerDirectory + '/brein-util/grunt/default-layout',
@@ -262,6 +266,9 @@ module.exports = function (grunt) {
262266
'target/dep/sha256.js',
263267
'target/dep/hmac.js',
264268

269+
'target/dep/moment.js',
270+
'target/dep/jstz.js',
271+
265272
'src/snippets/disable-global-jquery.js.snippet',
266273
'src/snippets/prefix-replace-window.js.snippet',
267274
'target/dep/**/*.js',

src/Breinify.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
var BreinifyUser = dependencyScope.BreinifyUser;
1616
var BreinifyConfig = dependencyScope.BreinifyConfig;
1717
var BreinifyUtil = dependencyScope.BreinifyUtil;
18+
var moment = dependencyScope.moment;
19+
var jstz = dependencyScope.jstz;
1820

1921
var ATTR_CONFIG = BreinifyConfig.ATTRIBUTES;
2022

@@ -264,12 +266,14 @@
264266
sign = typeof sign === 'boolean' ? sign : false;
265267

266268
if (timezone === null) {
267-
// get timezone from moment.js
268-
// moment().tz(moment.tz.guess()).format('z');
269+
// Determines the time zone of the browser client
270+
var tz = jstz.determine();
271+
var timezone = tz.name();
269272
}
270273

271274
if (localDateTime === null) {
272-
// get localDateTime from moment.js
275+
var date = moment.utc().format();
276+
localDateTime = date;
273277
}
274278

275279
// get the other values needed

0 commit comments

Comments
 (0)