npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-dl-datetimepicker

v0.1.7

Published

Un sélecteur de date et d'heure flexible pour React utilisant Moment.js.

Downloads

24

Readme

DateTimePicker React

Un sélecteur de date et d'heure flexible pour React utilisant Moment.js.

Installation

Pour installer ce composant, utilisez npm ou yarn comme suit :

npm install react-dl-datetimepicker

et

npm pre-use

ou

yarn add react-dl-datetimepicker

et

yarn pre-use

Utilisation

Pour utiliser ce composant dans votre projet React...

import React, { useState } from "react";
import moment from "moment";
import DateTimePicker from "react-dl-datetimepicker";
import { FORMAT_DATE } from "react-dl-datetimepicker/dist/Constants";

function App() {
  const [dateTime, setDateTime] = useState({
    date: moment(),
    time: {
      hour: moment().hour(),
      minute: moment().minute(),
      second: moment().second(),
    },
  });

  const handleDateTimeChange = (newDateTime) => {
    setDateTime(newDateTime);
  };
  return (
    <>
      <div className="container">
        <DateTimePicker
          value={dateTime}
          onChange={handleDateTimeChange}
          formatDate={FORMAT_DATE[0]}
          formatTime={"HH:mm"}
          LANGUAGE={"en"}
          showTime={false}
        />
      </div>
    </>
  );
}

export default App;

Props

Les props suivantes sont disponibles pour le DateTimePicker

| Props | Description | | -----------------: | ------------------------------------------------------------------------------------------------------------- | | language | Langue pour l'affichage du calendrier (utilisée avec moment.locale) | | value | L'objet contenant à la fois la date et l'heure sélectionnées. | | onChange | Fonction pour gérer les changements de date et d'heure. | | date | La date actuelle sélectionnée (objet moment ou équivalent). | | setDate | Fonction pour mettre à jour la date sélectionnée | | formatDate | Format de la date pour l'affichage et la saisie (voir fichier Constants.js, utiliser FORMAT_DATE[0]) | | disabledDates | Tableau de dates à désactiver (généralement au format YYYY-MM-DD'). | | disabledDaysOfWeek | Tableau des jours de la semaine à désactiver (par exemple, [0, 6] pour désactiver dimanche et samedi). | | showTime | Booléen pour indiquer si le sélecteur d'heure (TimePicker) doit être affiché avec le calendrier. | | time | L'heure actuelle sélectionnée, généralement sous la forme d'un objet avec des propriétés hour, minute, second | | setTime | Fonction pour mettre à jour l'heure sélectionnée. | | formatTime | Fomat de l'heure (voir Constant.js utiliser FORMAT_TIME[0]) | | disabledHours | Tableau d'heures à désactiver (par exemple, [0, 1, 23] pour désactiver minuit, 1h du matin, et 23h) | | style | Ajout de style CSS personnalisé en props |

Langues et Localisation

Pour changer la langue du composant DateTimePicker utiliser :

import "moment/locale/*"; // "*" = Utiliser en, es, de, etc...

puis passer en props comme suit :

<DateTimePicker language="fr" //... />

Licence

Ce projet est sous licence MIT. Voir le fichier LICENSE pour plus de détails.

Contribution

Les contributions à ce projet sont les bienvenues. Veuillez consulter les issues ouverts ou soumettre des pull requests.