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 🙏

© 2025 – Pkg Stats / Ryan Hefner

date-time-picker-dg

v1.0.4

Published

Este é um componente de seleção de data e horário altamente personalizável, compatível com todos os navegadores e projetado para integração fácil em projetos React.

Readme

DateTimePicker-dg

Este é um componente de seleção de data e horário altamente personalizável, compatível com todos os navegadores e projetado para integração fácil em projetos React.

📦 Instalação

Instale o pacote via npm:

npm install date-time-picker-dg

Ou via Yarn:

yarn add date-time-picker-dg

🚀 Uso Básico

Aqui está um exemplo de como usar o DateTimePicker em seu projeto React:

import React, { useState } from "react";
import DateTimePicker from "date-time-picker-dg";

const App = () => {
  const [datetime, setDatetime] = useState("");

  return (
    <div>
      <h1>Escolha a data e o horário</h1>
      <DateTimePicker
        onChange={(datetime) => setDatetime(datetime)}
      />
      <p>Data e Hora selecionadas: {datetime}</p>
    </div>
  );
};

export default App;

⚙️ Propriedades do Componente

| Propriedade | Tipo | Descrição | Valor Padrão | |------------------------------|-------------------------------|-------------------------------------------------------------------------|-----------------| | value | string | Valor inicial da data e hora no formato YYYY-MM-DD HH:mm. | undefined | | formatType | "ISO8601" | "ISO9075" | "UTC" | "timestamp" | Formato de saída da data e hora. | "ISO8601" | | className | string | Classe CSS personalizada para o input de data. | undefined | | containerClassName | string | Classe CSS para o container do DateTimePicker. | undefined | | timePickerClassName | string | Classe CSS para o input do CustomTimePicker. | undefined | | timePickerContainerClassName | string | Classe CSS para o container do CustomTimePicker. | undefined | | onChange | (datetime: string) => void | Função chamada ao selecionar uma data e hora. Retorna a string formatada. | Obrigatório |

💡 Exemplos de Uso

🔹 Com valores padrão

<DateTimePicker
  onChange={(datetime) => console.log(`Data e Hora selecionadas: ${datetime}`)}
/>

🎨 Personalizado

<DateTimePicker
  value="2025-02-15 08:30"
	formatType="UTC"
	className="flex w-max h-[38px] "
	containerClassName=" flex w-max flex-row border px-2 rounded-md items-center gap-2"
	timePickerClassName="flex w-max h-[38px] !p-0 !border-none !gap-1 "
	timePickerContainerClassName="!absolute !left-0 !right-0 !z-50 !mt-10 !w-max"
	onChange={(datetime) =>
		console.log(`Data e Hora selecionadas: ${datetime}`)
	}
/>

🎨 Estilização

O componente permite que o usuário defina estilos próprios, ao invés de trazer um CSS embutido. Para personalizar, basta sobrescrever os estilos do botão e do dropdown com seu próprio CSS:

Exemplo de Sobrescrita com Tailwind CSS

.custom-datetimepicker-input {
  @apply bg-blue-500 text-white border border-blue-600 hover:bg-blue-700;
}

.custom-datetimepicker-container {
  @apply bg-white border border-gray-300 shadow-lg rounded-md;
}

Exemplo de Sobrescrita com CSS Puro

.custom-datetimepicker-input {
  background-color: #3b82f6;
  color: white;
  border: 1px solid #2563eb;
}

.custom-datetimepicker-container {
  background-color: white;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}

🎯 Funcionalidades

  • Totalmente personalizável com cores e classes CSS.
  • Compatível com todos os navegadores modernos.
  • Responsivo e fácil de adaptar a qualquer design.
  • Efeitos suaves de fade-in e fade-out no dropdown.
  • Fecha automaticamente ao clicar fora.

📜 Licença

Este projeto está licenciado sob a MIT License.


🛠 Desenvolvido com ❤️ por David Gilmar Jr.