React = require 'react'
{Actions} = require("nylas-exports")
moment = require 'moment'
class CalendarBarItem extends React.Component
render: =>
style =
left: @props.item.xPercent
top: @props.item.yPercent
width: @props.item.wPercent
height: @props.item.hPercent
zIndex: @props.item.z
{@props.item.event.title}
{@_time()}
_time: =>
w = @props.item.event.when
if w.start_time
return moment.unix(w.start_time).format('h:mm a')
else if w.time
return moment.unix(w.time).format('h:mm a')
else if w.start_date
return moment.unix(w.start_date).format('MMMM Do')
else
return ""
_onClick: (event) =>
event.preventDefault()
Actions.focusTag(@props.tag)
module.exports = CalendarBarItem