freiksenet / react-calendar

A modular toolkit to build calendar-related things in React
http://freiksenet.github.io/react-calendar/
MIT License
249 stars 46 forks source link

Calendar "current" is broken #5

Open freiksenet opened 9 years ago

freiksenet commented 9 years ago

This is referring to the calendar highlighting the current month.

Codii commented 7 years ago

Here is what man can see in ./src/Month.js

const renderWeekHeader = (props) => {
  return (
    if (!props.weekdayNames) {
      return null;
    }

    <div className={`${clsPrefix}-weekdays`}>
      {
        daysOfWeek(props.date).map((weekday, i) =>
          <div key={ `weekday-header-${i}` } className={ classnames(`${clsPrefix}-weekdays-weekday`) }>
            { weekday.format(props.weekdayFormat) }
          </div>
        )
      }
    </div>
  );
};

With zoom

const renderWeekHeader = (props) => {
  return (
    if (!props.weekdayNames) {   /// !!!
      return null;               /// !!!
    }                            /// !!!

    <div className={`${clsPrefix}-weekdays`}>
      {
        daysOfWeek(props.date).map((weekday, i) =>