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

@blacksakura013/th-datepicker

v1.0.18

Published

Calendar for the year B.E. and B.E.

Downloads

35

Readme

Components react native to create a calendar that can run the calendar year, Buddhist era, and Christian era

Usage


import React, { useEffect, useState } from 'react';
import {
  SafeAreaView,
  Dimensions,
  StyleSheet,
  useColorScheme,
  View,
} from 'react-native';
import {
  Colors,
} from 'react-native/Libraries/NewAppScreen';
import { FontSize } from './src/react-native-datepicker-th//src/FontSizeHelper';
import CalendarScreen from '@blacksakura013/th-datepicker'
 
const deviceWidth = Dimensions.get('window').width;
const deviceHeight = Dimensions.get('window').height;

const App = () => {
  const isDarkMode = useColorScheme() === 'dark';
  const [Vel1, setVel1] = useState(new Date());
   const dateStr = '12/06/1998';
  const parts = dateStr.split('/');
  const [Vel2, setVel2] = useState(new Date(parts[2], parts[0] - 1, parts[1]));
  const backgroundStyle = {
    backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
  };

  useEffect(() => {
    console.log(Vel1)
  }, [Vel1]);

  useEffect(() => {
    console.log(Vel2)
  }, [Vel2]);

  return (
    <SafeAreaView style={backgroundStyle}>
      <View style={{ alignItems: 'center' }}>
        <CalendarScreen
          language={'th'}
          era={'be'}
          format={'dd month yyyy'}
          borderColor={Colors.buttonColorPrimary}
          linkTodateColor={Colors.itemColor}
          calendarModel={{ backgroundColor: Colors.backgroundColor, buttonSuccess: { backgroundColor: Colors.itemColor }, pickItem: { color: Colors.itemColor } }}
          borderWidth={1}
          icon={{ color: Colors.buttonColorPrimary }}
          fontSize={FontSize.medium}
          fontColor={Colors.fontColor}
          width={deviceWidth * 0.95}
          borderRadius={10}
          onChange={(vel) => setVel1(vel)} />
        <CalendarScreen
          language={'en'}
          era={'bc'}
          value={Vel2}
          format={'dd mon yyyy'}
          width={deviceWidth}
          onChange={(vel) => setVel2(vel)} />
      </View>
    </SafeAreaView>
  );
};


export default App;

version 1.0.16 update warning of translations/I18n

custom main styles

|NAME|PROPS TYPE|DATA FORMAT|DESCERIPTION| |----|-----|-------|-------| |height|number|0-99..|Set the height of the button| |width|number|0-99..|Set the width of the button| |fontSize|number|0-99..|Set font size of the button| |language|Text|TH/EN|Specify the language to set the desired language (supports English and Thai)| |value|Date|Date()|Set start date| |era|Text|BC/BE|Determine the type of calendar B.C. or B.E.| |format|Text|'DD/MM/YYYY''DD/MON/YYYY' 'DD/MONTH/YYYY' 'DD-MM-YYYY' 'DD-MON-YYYY' 'DD-MONTH-YYYY' 'DD MM YYYY' 'DD MON YYYY' 'DD MONTH YYYY'|Set the display format of the calendar| |padding|number|0-99..|Set the spacing of letters and button edges| |borderRadius|number|0-99..|Set the roundness of the button border| |borderColor|Text|color|Set the background color of the borderColor| |backgroundColor|Text|color|Set the background color of the button| |fontColor|Text|color|Set font color| |linkTodateColor|Text|color|Set font color|

custom icon

|NAME|PROPS TYPE|DATA FORMAT|DESCERIPTION| |----|-----|-------|-------| |name|Text|'carlenda'|Set icon image Reference icon from 'react-native-vector-icons/FontAwesome'| |size|number|0-99..|Set the icon size| |color|Text|color|Set the icon color|

custom calendarModel

|NAME|PROPS TYPE|DATA FORMAT|DESCERIPTION| |----|-----|-------|-------| |backgroundColor|Text|color|Set the calendar background color|

custom calendarModel dropdownlist

|NAME|PROPS TYPE|DATA FORMAT|DESCERIPTION| |----|-----|-------|-------| |borderRadius|number|0-99..|Set the roundness of the dropdownlist border| |borderWidth|number|0-99..|Set the width of the dropdownlist| |borderColor|Text|colorSet the dropdownlist border thickness |fontColor|Text|color|Set font color| |backgroundColor|Text|color|Set the background color of the dropdownlist|

custom calendarModel pickItem

|NAME|PROPS TYPE|DATA FORMAT|DESCERIPTION| |----|-----|-------|-------| |color|Text|color|Set pickItem color|

custom calendarModel buttonSuccess

|NAME|PROPS TYPE|DATA FORMAT|DESCERIPTION| |----|-----|-------|-------| |backgroundColor|Text|color|Set the background color of the buttonSuccess| |fontColor|Text|color|Set the font color of the buttonSuccess|

custom calendarModel buttonSuccess

|NAME|PROPS TYPE|DATA FORMAT|DESCERIPTION| |----|-----|-------|-------| |backgroundColor|Text|color|Set the background color of the buttonSuccess| |fontColor|Text|color|Set the font color of the buttonSuccess|

Please install these packages first

'react-native-vector-icons/FontAwesome'

'@react-native-picker/picker'

'react-native-localize'

'react-native-responsive-screen'