Move weekdays/months to util

master
Vitaliy Filippov 2016-09-11 22:38:08 +03:00
parent aaf6c661d5
commit 22544070ae
3 changed files with 5 additions and 4 deletions

View File

@ -1,6 +1,7 @@
const React = require('react');
const DropDownButton = require('./DropDownButton.js');
const Store = require('./Store.js');
const Util = require('./Util.js');
var MessageView = module.exports = React.createClass({
formatLongDate: function(dt)
@ -10,7 +11,7 @@ var MessageView = module.exports = React.createClass({
var h = dt.getHours();
var m = dt.getMinutes();
var s = dt.getSeconds();
return WeekDays[dt.getDay()]+' '+dt.getDate()+' '+Months[dt.getMonth()]+' '+dt.getFullYear()+' '+(h < 10 ? '0' : '')+h+':'+(m < 10 ? '0' : '')+m+':'+(s < 10 ? '0' : '')+s
return Util.WeekDays[dt.getDay()]+' '+dt.getDate()+' '+Util.Months[dt.getMonth()]+' '+dt.getFullYear()+' '+(h < 10 ? '0' : '')+h+':'+(m < 10 ? '0' : '')+m+':'+(s < 10 ? '0' : '')+s
//return dt.toLocaleString();
},
componentDidMount: function()

View File

@ -1,3 +1,6 @@
var WeekDays = module.exports.WeekDays = [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ];
var Months = module.exports.Months = [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ];
module.exports.formatBytes = function(s)
{
if (!s) return '';

View File

@ -12,9 +12,6 @@ const Store = require('./Store.js');
window.requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame;
var WeekDays = [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ];
var Months = [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ];
var dropdown_account = React.createElement(
DropDownMenu, {
id: 'account',