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

To help you get started, we’ve selected a few @commercetools-uikit/calendar-time-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-time-input / date-time-input.js View on Github external
prevState => ({
        calendarDate: today,
        highlightedIndex:
          prevState.suggestedItems.length +
          getDateInMonth(today, this.props.timeZone) -
          1,
      }),
      () => this.inputRef.current.focus()
github commercetools / ui-kit / src / components / inputs / date-time-input / date-time-input.js View on Github external
name: PropTypes.string,
    placeholder: PropTypes.string,
    isDisabled: PropTypes.bool,
    isReadOnly: PropTypes.bool,
    hasError: PropTypes.bool,
    hasWarning: PropTypes.bool,
  };
  inputRef = React.createRef();
  timeInputRef = React.createRef();
  state = {
    calendarDate: getToday(this.props.timeZone),
    suggestedItems: [],
    highlightedIndex:
      this.props.value === ''
        ? null
        : getDateInMonth(this.props.value, this.props.timeZone) - 1,
    timeString: '',
  };
  jumpMonths = amount => {
    this.setState(prevState => {
      const nextDate = changeMonth(
        prevState.calendarDate,
        this.props.timeZone,
        amount
      );
      return { calendarDate: nextDate, highlightedIndex: 0 };
    });
  };
  showToday = () => {
    const today = getToday(this.props.timeZone);
    this.setState(
      prevState => ({