Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I'm having this issue as well. Date picker does not display the correct value in date, min and max parameter and font color as well. #32

Open
danielprrazevedo opened this issue Mar 1, 2021 · 4 comments

Comments

@danielprrazevedo
Copy link
Member

I'm having this issue as well. Date picker does not display the correct value in date, min and max parameter and font color as well.

Simulator Screen Shot - iPhone 11 Pro Max - 2021-02-28 at 11 25 38

{ date: '28/02/2021' } and the format is DD/MM/YYYY using moment-timezone

Originally posted by @jreybaylen in #31 (comment)

@danielprrazevedo
Copy link
Member Author

@jreybaylen
Please post some information so i can know what the problem might be

  • the exact payload of the present call
  • the device language
  • the device timezone

I understand that the plugin is not dealing with timezone in a satisfactory way, I would like more information to understand and address this as soon as possible.

@jreybaylen
Copy link

@danielprrazevedo thank you for response. Here's my payload

const showDatePicker = async (t: Function, date: string, callback?: Function) => {
    const format = 'YYYYMMDD'
    const currentDateTime = moment()
    const newDate = moment(date).format(format)
    const maxDate = currentDateTime.format(format)
    const minDate = currentDateTime.subtract(60, 'days').format(format)

    Plugins.DatePickerPlugin.present({
        format,
        mode: 'date',
        min: minDate,
        max: maxDate,
        date: newDate,
        theme: 'light',
        doneText: t('Common.confirm'),
        cancelText: t('Common.cancel'),
        timezone: environment.TIME_ZONE // America/New_York
    }).then((date: { value: string }) => {
        if (date.value && callback) {
            callback(newDate)
        }
    })
}

@jreybaylen
Copy link

If I remove the parameter date, min and max as payload it will work as expected. Please check font color parameter as well. Thank you

@jreybaylen
Copy link

jreybaylen commented Apr 5, 2021

@danielprrazevedo can you please close now this issue? The problem is format parameter. It should yyyy-MM-dd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants