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

@saksham-gupta-1024/react-native-custom-date-picker

v1.0.2

Published

The React Native Date Picker Library is a versatile and customizable date picker component for React Native applications. This library is designed to provide cross-platform support, enabling it to run seamlessly on both iOS and Android platforms. With var

Downloads

14

Readme

react-native-custom-date-picker

The React Native Date Picker Library is a versatile and customizable date picker component for React Native applications. This library is designed to provide cross-platform support, enabling it to run seamlessly on both iOS and Android platforms. With various customization options, you can tailor the date picker to suit your application's design and functionality.

Screenshots

Works same way on both ios and android platform. | Day | Month | Year | Labels | | :------- |:------- | :------- | :--------- | |App Screenshot|App Screenshot|App Screenshot|App Screenshot|

Installation

To install this package with npm use following command inside project root directory

  • If you are using npm use this

    npm i @saksham-gupta-1024/react-native-custom-date-picker
  • If you are using yarn use this

    yarn add @saksham-gupta-1024/react-native-custom-date-picker

Features

  • Cross-Platform Support

    The React Native Date Picker Library is compatible with both iOS and Android, ensuring a consistent user experience across different platforms.

  • Fully Customizable

    Customize the date picker to match your application's visual style and requirements. You can modify various aspects, including:

    • Background color
    • Title
    • Formate etc...
  • Three Main Date Formats

    This library offers three primary date formats based on the specified type prop:

    • Day (mode="day")

      Displays the date in the dd-mm-yyyy format.

    • Month (mode="month")

      Displays the date in the mm-yyyy format.

    • Year (mode="year")

      Displays the date in the yyyy format.

Usage/Examples

import React, { useState } from 'react';
import { Button, View } from 'react-native';
import DatePicker from 'react-native-custom-date-picker';

const Example = () => {
	const [isDatePickerVisible, setDatePickerVisibility] = useState(false);

	const showDatePicker = () => {
		setDatePickerVisibility(true);
	};

	const hideDatePicker = () => {
		setDatePickerVisibility(false);
	};

	const handleSelect = (date) => {
		console.log('Selected Date: ', date);
		hideDatePicker();
	};

	const handleReset = (date) => {
		console.log('Reset Date: ', date);
		hideDatePicker();
	};

	return (
		<View>
			<Button title='Show Date Picker' onPress={showDatePicker} />
			<DatePicker
				isVisible={isDatePickerVisible}
				mode='year'
				startYear={2000}
				endYear={2050}
				defaultValue={2023}
				showTitle={true}
				onSelect={handleSelect}
				onReset={handleReset}
				onClose={hideDatePicker}
			/>
		</View>
	);
};

export default Example;

Props

| Prop | Type | Default | Description | | :------------------------------ | :-------- | :------------------ | :------------------------------------------------------------------------------- | | isVisible | boolean | Required | Determine whether to show date-picker or not. | | mode | string | "day" | Specifies the date format type ("day", "month", or "year"). | | startYear | number | Required | Specifies the start year for picker eg: 2000. | | endYear | number | Required | Specifies the end year for picker eg: 2050. | | backgroundColor | string | "#FFFFFF" | Specifies the model background color. | | showTitle | boolean | Required | Determine whether to show title or not. | | title | string | "Selected Date: " | Specifies the title text. | | titleColor | string | "#000000" | Specifies the title text color. | | defaultValue | string | Required | Specifies the default date eg: day: "15-09-2000", month: "09-2000", year: "2000" | | selectedViewBackgroundColor | string | "#d3d3d3" | Specifies the selected view color. | | selectedViewTextColor | string | "#000000" | Specifies the selected view text color. | | unselectedViewBackgroundColor | string | "#f9f9f9" | Specifies the unselected view color. | | unselectedViewTextColor | string | "#949494" | Specifies the unselected view text color. | | selectButtonText | string | "Select" | Specifies the reset button text label. | | selectButtonBackgroundColor | string | "#2196F3" | Specifies the select button color. | | selectButtonTextColor | string | "#FFFFFF" | Specifies the select button text color. | | resetButtonText | string | "Reset" | Specifies the reset button text label. | | resetButtonBackgroundColor | string | "#d3d3d3" | Specifies the reset button color. | | resetButtonTextColor | string | "#FFFFFF" | Specifies the reset button text color. | | crossButtonTintColor | string | "#000000" | Specifies the cross button tint color. | | crossButtonBackgroundColor | string | "#d3d3d3" | Specifies the cross button background color. |

Methods

| Name | Return type | Description | | :--------- | :---------- | :------------------------------------------------------------------------ | | onReset | string | Sets default date. | | onSelect | string | Returns selected date eg: day:"15-09-2000", month:"09-2000", year:"2000". | | onClose | void | Closes date picker model. |

Author

Support

  • If you like this package, consider giving it a github → star ⭐ Also, PR's are welcome!

  • For support, email or join our Slack channel.