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) { if (!(dt instanceof Date)) dt = new Date(dt.replace(' ', 'T')); var h = dt.getHours(); var m = dt.getMinutes(); var s = dt.getSeconds(); 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() { Store.on('quickReply', this.setQuickReply); Store.on('msg', this.setMsg); }, componentWillUnmount: function() { Store.un('quickReply', this.setQuickReply); Store.un('msg', this.setMsg); }, setQuickReply: function() { this.setState({ quickReply: Store.quickReply }); }, setMsg: function() { this.setState({ msg: Store.msg }); }, getInitialState: function() { return { quickReply: Store.quickReply }; }, render: function() { var msg = this.state.msg; return