Handle timezones
This commit is contained in:
parent
019a643f94
commit
b7338eeab7
@ -1,17 +1,23 @@
|
||||
module.exports = function(grunt) {
|
||||
var libs = "client/js/libs/**/*.js";
|
||||
grunt.initConfig({
|
||||
watch: {
|
||||
files: libs,
|
||||
tasks: ["uglify"]
|
||||
},
|
||||
uglify: {
|
||||
options: {
|
||||
compress: false
|
||||
},
|
||||
js: {
|
||||
files: {
|
||||
"client/js/libs.min.js": "client/js/libs/**/*.js"
|
||||
"client/js/libs.min.js": libs
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
grunt.loadNpmTasks("grunt-contrib-uglify");
|
||||
grunt.loadNpmTasks("grunt-contrib-watch");
|
||||
grunt.registerTask(
|
||||
"default",
|
||||
["uglify"]
|
||||
|
@ -236,7 +236,7 @@
|
||||
{{#each messages}}
|
||||
<div class="msg {{type}}">
|
||||
<span class="time">
|
||||
{{time}}
|
||||
{{tz time}}
|
||||
</span>
|
||||
<span class="from">
|
||||
{{#if from}}
|
||||
|
15
client/js/libs.min.js
vendored
15
client/js/libs.min.js
vendored
File diff suppressed because one or more lines are too long
6
client/js/libs/handlebars/tz.js
Normal file
6
client/js/libs/handlebars/tz.js
Normal file
@ -0,0 +1,6 @@
|
||||
Handlebars.registerHelper(
|
||||
"tz", function(time) {
|
||||
var utc = moment.utc(time, "HH:mm:ss").toDate();
|
||||
return moment(utc).format("HH:mm");
|
||||
}
|
||||
);
|
2610
client/js/libs/moment.js
Normal file
2610
client/js/libs/moment.js
Normal file
File diff suppressed because it is too large
Load Diff
@ -23,7 +23,7 @@ function Msg(attr) {
|
||||
_.merge(this, _.extend({
|
||||
from: "",
|
||||
text: "",
|
||||
time: moment().format("HH:mm"),
|
||||
time: moment().utc().format("HH:mm:ss"),
|
||||
type: Msg.Type.MESSAGE
|
||||
}, attr));
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
"single-instance": false,
|
||||
"window": {
|
||||
"title": "Shout",
|
||||
"icon": "client/img/favicon.png",
|
||||
"icon": "client/img/favicon.png",
|
||||
"toolbar": false,
|
||||
"width": 1024,
|
||||
"height": 640
|
||||
@ -42,6 +42,6 @@
|
||||
"devDependencies": {
|
||||
"grunt": "~0.4.5",
|
||||
"grunt-contrib-uglify": "~0.5.0",
|
||||
"grunt-node-webkit-builder": "~0.1.21"
|
||||
"grunt-contrib-watch": "^0.6.1"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user