Giter VIP home page Giter VIP logo

react-native-common-date-picker's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

react-native-common-date-picker's Issues

确实太卡了....

三栏选日期的时候 滑动日期还得等一会才能反应得过来...

我有两个手机 一个小米 一个华为 只在华为上出现过这个问题

还有 使用 Android Studio 模拟器 也会很卡

    • ! 因为这个原因 不得不考虑其他日期选择组件了

展示有问题

展示不全,有时候只展示月份,有时候是年份,年月日展示随机

Can't change the fontFamily

I want to change the font family of text called year, month, and date. Unfortunately, I can't see any parameter named like that. Could you shed some light on that?

Friday & Saturday are missing from calendar

can check is something need to add in this ?

<CalendarList
firstDayOnWeeks={0}
showWeeks={false}
minDate='2022-01-01'
maxDate={new Date()}
containerStyle={{ flex: 1 }}
cancel={() => toggleModel(false)}
confirm={data => {
toggleModel(false);
onDateChange(data[0], data[1])
}}
toolBarPosition="bottom"
confirmText="Apply"
/>

CalendarList doesn't focus on current date

Hello,

I am trying to make the CalendarList to focus on a specific date upon appearance by setting defaultDates to some value,
but the component keeps focusing on the minDate. The code below is what i use.

<CalendarList
    containerStyle={{ flex: 1 }}
    titleText="Select Date"
    showToolBar={false}
    cancel={() => setVisibleCallendar(false)}
    onPressDate={(date) => {
        setSelectedCalendarDate(date);
        setVisibleCallendar(false);
    }}
    minDate={'2021-01-01'}
    maxDate={new Date()}
    defaultDates={[new Date(), new Date()]}
/>

In my opinion the expected behavior of a datepicker is to show the current date on render not the minDate.

Is there any way to achieve this?

I'm on version: 2.3.6


Update - Workaround

I found this in the CalendarList source code:

/**
* See FlatList docs. If you'd like to do something outside. e.g: you maybe want to scroll to the end. Then you can
* use "<CalendarList ref={ref => this.calendarList = ref}; this.calendarList.scrollToEnd()" to make it work for you.
*/

I am using functional components with hooks so i added a React.useRef along with <CalendarList ref={calendarRef} ....otherprops on the component.

Even though this works, i still believe that it would be good to be able to define the initial focus date as part of the provided props.

onPressDate 回调问题

onPressDate 点击两次才能调用一次
应该每次都调用 然后我们可以自己定义底部工具栏 判断是否可以点击

Disabled dates

is it possible to disable some dates? as for some reservation systems you cant select certain dates which are booked already.

Day and date values do not match when used with negative offset timezones

version: 2.3.4

Issue:
• When the device is set in a negative offset time-zone, we observed that for any date the day is shown ahead of the actual day. i.e. 20 November 2021 is shown on Friday instead of Saturday.
• For a positive offset time-zone, we observed that it is displayed correctly.

Here are two screen shots:

Negative_Offset
positive_offset

Calendar lags

CalendarList blocks js thread for some time when opened in modal
Following is example code

import React from 'react'
import { View, StyleSheet } from 'react-native'
import { CalendarList } from "react-native-common-date-picker"
import Modal from 'react-native-modal'


function CalendarDialog(props) {
    const { isVisible, onHideDialog, onConfirmDateRange } = props


    function hideDialog() {
        onHideDialog && onHideDialog()
    }

    function confirmDateRange(range) {
        onConfirmDateRange && onConfirmDateRange(range)
    }

    function renderCalendar() {
        return (
            <View style={styles.container}>
                <CalendarList
                    minDate={'2020-5-23'}
                    maxDate={'2025-6-6'}
                    titleText={'Select Date Range'}
                    cancel={() => hideDialog()}
                    headerTitleType={5}
                    selectedDateMarkType={'circle'}
                    selectedDateMarkColor={'red'}
                    selectedDateMarkRangeColor={'orange'}
                    headerTitleType={2}
                    horizontal={true}
                    pagingEnabled={true}
                    confirm={data => confirmDateRange(data)}
                />
            </View>
        )
    }

    return (
        <Modal
            testID={'modal'}
            isVisible={isVisible}
            style={{margin:0}}
            onBackdropPress={() => hideDialog()}
            onSwipeComplete={() => hideDialog()}
            transparent={true} 
            swipeDirection={['down']}
            propagateSwipe={true}>
            {renderCalendar()}
        </Modal>
    )

}

const styles = StyleSheet.create({
    container: {
        flex: 1, 
        justifyContent: 'flex-end', 
        backgroundColor: 'rgba(0,0,0,0.5)'
    }
})

export default CalendarDialog

使用react-native-camera组件扫描二维码后日期显示不正常

<DatePicker confirm={date => { this.confirmDate(date); }} cancel={() => this.dateClear()} cancelText={cancelText} toolBarCancelStyle={{color:'#158EE9',}} confirmText={okText} toolBarConfirmStyle={{color:'#158EE9',}} monthDisplayMode = {'en-long'} maxDate={maxDate} defaultDate={new Date()} // onValueChange={date => this.onDateChange(date)} />

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.