How to use the rc-calendar/lib/util/index.getTitleString function in rc-calendar

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>

rc-calendar

React Calendar

MIT
Latest version published 4 years ago

Package Health Score

65 / 100
Full package analysis