How to use rc-calendar - 3 common examples

To help you get started, we’ve selected a few rc-calendar 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 diplomatiegouvfr / hornet-js / hornet-js-react-components / src / widget / form / calendar-field.tsx View on Github external
export interface CalendarFieldState {
    isVisible?: boolean;
    strValue?: string;
    calendarLocale?: any;
    inputSize?: number;
    onValueChange?: (value: string) => void;
}

if (!Utils.isServer) {
    logger.trace("Execution sur le CLIENT(NAVIGATEUR)");
    RcCalendar = require("rc-calendar");
    /* Patch de la méthode getTitleString utilisée pour afficher la date correspondant au jour survolé dans le calendrier */
    const rcCalendarUtil = require("rc-calendar/lib/util/index");

    if (rcCalendarUtil && rcCalendarUtil.getTitleString) {
        rcCalendarUtil.getTitleString = (value?: string) => {
            /* On renvoie une chaîne vide car le formattage de la date dépend de la locale qui est propre à chaque
             instance de calendar. */
            return "";
        };
    }
} else {
    logger.trace("Execution sur le SERVEUR");
}

/**
 * Composant Calendrier
 */
export class CalendarField<p>
    extends InputField {

    protected hasKeyPress: boolean = false;
</p>
github diplomatiegouvfr / hornet-js / hornet-js-react-components / src / widget / form / calendar-field.tsx View on Github external
*/
export interface CalendarFieldState {
    isVisible?: boolean;
    strValue?: string;
    calendarLocale?: any;
    inputSize?: number;
    onValueChange?: (value: string) =&gt; void;
}

if (!Utils.isServer) {
    logger.trace("Execution sur le CLIENT(NAVIGATEUR)");
    RcCalendar = require("rc-calendar");
    /* Patch de la méthode getTitleString utilisée pour afficher la date correspondant au jour survolé dans le calendrier */
    const rcCalendarUtil = require("rc-calendar/lib/util/index");

    if (rcCalendarUtil &amp;&amp; rcCalendarUtil.getTitleString) {
        rcCalendarUtil.getTitleString = (value?: string) =&gt; {
            /* On renvoie une chaîne vide car le formattage de la date dépend de la locale qui est propre à chaque
             instance de calendar. */
            return "";
        };
    }
} else {
    logger.trace("Execution sur le SERVEUR");
}

/**
 * Composant Calendrier
 */
export class CalendarField<p>
    extends InputField {

</p>
github cockroachdb / cockroach-gen / pkg / ui / src / components / rangeCalendar / rangeCalendar.tsx View on Github external
import { noop } from "lodash";
import { TimePicker } from "antd";
import { TimePickerProps } from "antd/es/time-picker";
import RcRangeCalendar from "rc-calendar/es/RangeCalendar";
import locale from "rc-calendar/es/locale/en_US";
import "rc-calendar/assets/index.css";
import classNames from "classnames/bind";
import { CaretDown } from "@cockroachlabs/icons";

import { Button } from "src/components";
import styles from "./rangeCalendar.module.styl";
import { DateRangeLabel } from "./dateRangeLabel";

const cx = classNames.bind(styles);

locale.monthFormat = "MMMM";

interface OwnProps {
  timeFormat?: string;
  minTimeRange?: [DurationInputArg1, DurationInputArg2];
  onSubmit?: (range: [Moment, Moment]) => void;
  onCancel?: () => void;
  onInvalidRangeSelect?: (allowedRange: [DurationInputArg1, DurationInputArg2]) => void;
  showBorders?: boolean;
}

interface RcTimePickerProps {
  align: {
    offset: [number, number];
  };
}

rc-calendar

React Calendar

MIT
Latest version published 4 years ago

Package Health Score

62 / 100
Full package analysis