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

greentea-thaidatepicker-react

v0.0.2

Published

Fork from Thaidatepicker-react is a component for ReactJS that likes other DatePicker, but all we need is Buddhist Year (25XX – aka Thai Year) come with the right render day (example: Sat, 29 Feb 2020 must be equal to Sat, 29 Feb 2563) so I wish this comp

Downloads

1

Readme

greentea-thaidatepicker-react

📋 Features

  • minDate The minimum date that can be selected, possible value "2020-02-29", dayjs and also Moment.
  • maxDate The maximum date that can be selected, possible value "2020-02-29", dayjs and also Moment.
  • value The default value, possible value "2020-02-29", dayjs and also Moment.
  • onChange The handler function, this function returns a couple of value (ChristDate, BuddhistDate)
  • displayFormat The value's display format on Input, only display which not effected to the value, possible value is "ddd, DD MMMM YYYY" which is dayjs formatting. Note: Current is not supported "Localized formats" like "L LL LLL LLLL" or stuff. please see more at dayjs
  • clearable The small button to allow user clear the selected value, possible value true, false
  • inputStyle The style customization.
  • dateFormat The format of value, possible value is "yyyy-MM-dd" please see more at date-fns

⚙ Install

npm i greentea-thaidatepicker-react
# or just `yarn add greentea-thaidatepicker-react`

📌 Usage

import React, { useState } from 'react'
import dayjs from 'dayjs'
import { WatDatePicker } from 'greentea-thaidatepicker-react'

const App = () => {
  const [selectedDate, setSelectedDate] = useState("2020-04-27")
  const [selectedThaiDate, setSelectedThaiDate] = useState("2563-04-27")

  const handleWatDatePickerChange = (christDate, buddhistDate) => {
    console.log(christDate)
    console.log(buddhistDate);
    setSelectedDate(christDate)
    setSelectedThaiDate(buddhistDate)
  }

  return (
    <>
      <WatDatePicker
        value={selectedDate} // Can be replace with string or dayjs object (e.g. "2020-12-31" or `dayjs()`)
        onChange={handleWatDatePickerChange}
        dateFormat={'yyyy-MM-dd'} // for set data purpose [using date-fns format](https://date-fns.org/v2.12.0/docs/format)
        displayFormat={'dd, DD MMMM YY'} // for display purpose (using dayjs format)[https://day.js.org/docs/en/display/format]
        inputStyle={{ color: 'red' }} // styles for input
        minDate={'2020-12-26'} // supported date as string
        maxDate={dayjs().add(20, 'day')} // also supported dayjs or moment
      />
    </>
  )
}

export default App

📝 Example

Please go to example directory or click to App.js

License

MIT © buildingwatsize

⚒ Thanks a lot