How to use the @commercetools-uikit/calendar-utils.isSameDay function in @commercetools-uikit/calendar-utils

To help you get started, we’ve selected a few @commercetools-uikit/calendar-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github commercetools / ui-kit / src / components / inputs / date-input / date-input.js View on Github external
{
                            setDownshiftHighlightedIndex(null);
                          },
                        })}
                        isHighlighted={index === downshiftHighlightedIndex}
                        isSelected={isSameDay(item, props.value)}
                      >
                        {getCalendarDayLabel(item)}
                      
                    ))}
github commercetools / ui-kit / src / components / inputs / date-input / date-input.js View on Github external
{calendarItems.map((item, index) => (
                       {
                            setDownshiftHighlightedIndex(null);
                          },
                        })}
                        isHighlighted={index === downshiftHighlightedIndex}
                        isSelected={isSameDay(item, props.value)}
                      >
                        {getCalendarDayLabel(item)}
github commercetools / ui-kit / src / components / inputs / date-range-input / date-range-input.js View on Github external
highlightedIndex;
                        const {
                          isRangeStart,
                          isRangeBetween,
                          isRangeEnd,
                        } = getRange({
                          item,
                          value: this.props.value,
                          startDate: this.state.startDate,
                          highlightedItem:
                            allItems[this.state.highlightedIndex],
                        });
                        return (
                           {
                                setHighlightedIndex(null);
                              },
                            })}
                            isHighlighted={isHighlighted}
                            isRangeStart={isRangeStart}
                            isRangeBetween={isRangeBetween}
                            isRangeEnd={isRangeEnd}
                          >
                            {getCalendarDayLabel(item)}
                          
                        );
                      })}
github commercetools / ui-kit / src / components / inputs / date-range-input / date-range-input.js View on Github external
const getRange = ({ item, value, startDate, highlightedItem }) => {
  const isRangeSelectionInProgress = startDate;
  const hasSelection = value.length === 2;
  const isStartDate = isSameDay(item, startDate);

  const isBetween =
    highlightedItem && isBetweenDates(item, startDate, highlightedItem);

  let isRangeStart = false;
  if (isRangeSelectionInProgress) {
    isRangeStart = isStartDate;
  } else if (hasSelection) {
    isRangeStart = value[0] === item;
  }

  let isRangeBetween = false;
  if (isRangeSelectionInProgress) {
    isRangeBetween = isBetween;
  } else if (hasSelection) {
    isRangeBetween = isBetweenDates(item, value[0], value[1]);