text: import React, { Component } from 'react';
  import moment from 'moment/min/moment-with-locales.min';
  
  export default class Time extends React.Component {
      render() {
          return (
              <div style={[styles[this.props.position].container, this.props.containerStyle[this.props.position]]}>
                  <p style={[styles[this.props.position].text, this.props.textStyle[this.props.position]]}>
                      {moment(this.props.currentMessage.createdAt).locale(this.context.getLocale()).format('LT')}
                  </p>
              </div>
          );
      }
  }
  
  const containerStyle = {
      marginLeft: 10,
      marginRight: 10,
      marginBottom: 5,
  };
  
  const textStyle = {
      fontSize: 10,
      backgroundColor: 'transparent',
      textAlign: 'right',
  };
  
  const styles = {
      left: {
          container: {
              ...containerStyle,
          },
          text: {
              color: '#aaa',
              ...textStyle,
          },
      },
      right: {
          container: {
              ...containerStyle,
          },
          text: {
              color: '#fff',
              ...textStyle,
          },
      },
  };
  
  Time.contextTypes = {
      getLocale: React.PropTypes.func,
  };
  
  Time.defaultProps = {
      position: 'left',
      currentMessage: {
          createdAt: null,
      },
      containerStyle: {},
      textStyle: {},
  };
  
  Time.propTypes = {
      position: React.PropTypes.oneOf(['left', 'right']),
      currentMessage: React.PropTypes.object,
      containerStyle: React.PropTypes.shape({
          left: View.propTypes.style,
          right: View.propTypes.style,
      }),
      textStyle: React.PropTypes.shape({
          left: Text.propTypes.style,
          right: Text.propTypes.style,
      }),
  };
  