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 🙏

© 2026 – Pkg Stats / Ryan Hefner

mainam-react-native-date-picker

v8.0.4

Published

Thư viện chọn ngày/giờ dạng modal cho React Native, có giao diện riêng cho iOS và Android. Phiên bản hiện tại hướng tới React Native `0.80.3`, React `19.1.0`.

Readme

mainam-react-native-date-picker

Thư viện chọn ngày/giờ dạng modal cho React Native, có giao diện riêng cho iOS và Android. Phiên bản hiện tại hướng tới React Native 0.80.3, React 19.1.0.

Cài đặt

npm install mainam-react-native-date-picker

Các dependency native cần được liên kết theo cơ chế autolinking của React Native:

  • @react-native-community/datetimepicker
  • react-native-wheel-picker-android
  • react-native-modal

Cách dùng nhanh

import DatePicker from 'mainam-react-native-date-picker';

export default function Example() {
  return (
    <DatePicker
      isVisible
      mode="date"
      date={new Date()}
      titleIOS="Chọn ngày"
      confirmTextIOS="Đồng ý"
      cancelTextIOS="Hủy"
      onConfirm={(date) => console.log(date)}
      onCancel={() => console.log('Đã hủy')}
    />
  );
}

Props chính

| Prop | Kiểu | Mặc định | Mô tả | | --- | --- | --- | --- | | isVisible | boolean | false | Điều khiển trạng thái hiển thị modal. | | mode | 'date' \| 'time' \| 'datetime' \| 'month' | 'date' | Chế độ chọn ngày, giờ hoặc tháng. | | date | Date | new Date() | Ngày mặc định cho picker. | | time | Date | Không có | Giờ mặc định cho Android time picker. | | minimumDate | Date | Không có | Ngày/giờ nhỏ nhất được phép chọn. | | maximumDate | Date | Không có | Ngày/giờ lớn nhất được phép chọn. | | onConfirm | function | Bắt buộc | Callback nhận Date sau khi người dùng xác nhận. | | onCancel | function | Bắt buộc | Callback khi người dùng hủy modal. | | onHideAfterConfirm | function | () => {} | Callback sau khi modal iOS ẩn xong và đã confirm. | | titleIOS | string | 'Chọn ngày' | Tiêu đề modal chọn ngày. | | titleTime | string | 'Chọn giờ' | Tiêu đề modal Android khi mode="time". | | confirmTextIOS | string | 'Confirm' | Nội dung nút xác nhận. | | cancelTextIOS | string | 'Cancel' | Nội dung nút hủy. | | reactNativeModalPropsIOS | object | {} | Props truyền thêm cho react-native-modal. |

Cấu trúc mã nguồn

  • index.js: chọn implementation theo Platform.OS.
  • ios/index.js: modal dùng @react-native-community/datetimepicker.
  • android/CustomDatePickerAndroid.js: modal Android dùng picker dạng wheel.
  • android/DatePicker.js: wheel chọn tháng/ngày/năm.
  • android/TimePicker.js: wheel chọn giờ/phút.
  • scripts/check-syntax.js: kiểm tra cú pháp source bằng Babel parser.

Kiểm tra

npm test

Lệnh trên parse toàn bộ file source chính để phát hiện lỗi cú pháp JSX, Flow và class properties. Ngoài ra, repo còn kiểm tra hồi quy cho react-native-modal để chắc chắn dependency này không còn dùng BackHandler.removeEventListener(...), là nguyên nhân gây lỗi undefined is not a function khi đóng modal trên React Native mới.

Lưu ý môi trường

React Native 0.80.3 yêu cầu Node >=18. Nếu chạy npm install bằng Node thấp hơn, npm sẽ cảnh báo EBADENGINE.