Move weekdays/months to util
parent
aaf6c661d5
commit
22544070ae
|
@ -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()
|
||||
|
|
3
Util.js
3
Util.js
|
@ -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 '';
|
||||
|
|
3
mail.js
3
mail.js
|
@ -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',
|
||||
|
|
Loading…
Reference in New Issue