react-icons/ri#RiCalendarEventFill JavaScript Examples

The following examples show how to use react-icons/ri#RiCalendarEventFill. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ConferencesCard.js    From hackertab.dev with Apache License 2.0 5 votes vote down vote up
ConferenceItem = ({ conf, index, analyticsTag }) => {
  
  const { listingMode } = useContext(PreferencesContext)

  const formatConfsDate = (date) => {
    const monthNames = ["January", "February", "March", "April", "May", "June",
      "July", "August", "September", "October", "November", "December"
    ];

    return `${monthNames[date.getMonth()]} ${("0" + date.getDate()).slice(-2)}`

  }

  const ConferenceLocation = () => {
    return (
      conf.online ?
        "? Online" :
        `${flag(conf.country.replace(/[^a-zA-Z ]/g, ""))} ${conf.city}`
    )
  }

  const ConferenceDate = () => {
    let value = ""
    if (conf.startDate) {
      value = `${formatConfsDate(conf.startDate)}`
    }
    if (conf.endDate && conf.endDate > conf.startDate) {
      value = `${value} - ${
        conf.endDate.getMonth() === conf.startDate.getMonth() ?
          ("0" + conf.endDate.getDate()).slice(-2)
          : formatConfsDate(conf.endDate)
        }`
    }
    return value
  }
  return (
    <CardItemWithActions
      source={'conferences'}
      index={index}
      key={index}
      item={{ ...conf, title: conf.name }}
      cardItem={(
        <>
          <CardLink link={conf.url} analyticsSource={analyticsTag}>
            <RiCalendarEventFill className={"rowTitleIcon"} />
            {conf.name}
          </CardLink>
          {
            listingMode === "normal" ?
            <>
              <div className="rowDescription">
                <span className="rowItem"><IoIosPin className="rowItemIcon" /> {ConferenceLocation()}</span>
                <span className="rowItem"><MdAccessTime className="rowItemIcon" /> {ConferenceDate()}</span>
              </div>
              <div className="rowDetails">
                <ColoredLanguagesBadge languages={[conf.tag.value]} />
              </div>
            </> :
            <div className="rowDescription">
              <span className="rowItem"><MdAccessTime className="rowItemIcon" /> {ConferenceDate()}</span>
            </div>
          }
          
        </>
      )}
    />
  )
}