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

datepicker date not working #36

Closed
gusdecool opened this issue Aug 3, 2016 · 8 comments
Closed

datepicker date not working #36

gusdecool opened this issue Aug 3, 2016 · 8 comments

Comments

@gusdecool
Copy link

Tested with this code:

<app-datepicker-dialog id="endDatePicker" date="2017/05/17" with-backdrop entry-animation="datepicker-slide-from-bottom-animation" exit-animation="datepicker-slide-from-top-animation"></app-datepicker-dialog>

notice that date is set 2017/05/17 but when the dialog opened it still show today date. e.g: 2016/08/03

How come?

@motss
Copy link
Owner

motss commented Aug 3, 2016

@gusdecool input-date is the right property for you to set a date while date is the output date when you select a date from the datepicker.

<app-datepicker input-date="2017/05/17" date="{{selectedDate}}"></app-datepicker>

@gusdecool
Copy link
Author

Thanks @motss will try it again tomorrow and back to you 👍

@motss
Copy link
Owner

motss commented Aug 3, 2016

@gusdecool just let me know if that solved that problem.

@gusdecool
Copy link
Author

gusdecool commented Aug 4, 2016

@motss the solution didn't work.

scenario: i want to use datepicker with date that i have from polymer properties as the input date and this property will changed based on your datepicker

here is the code:

<paper-button on-tap="openStartDate">{{ plan.startDate }}</paper-button>

<app-datepicker-dialog id="startDatePicker"
                                                   date="{{ plan.startDate }}"
                                                   input-date="{{ plan.startDate }}"
                                                   with-backdrop
                                                   entry-animation="datepicker-slide-from-bottom-animation"
                                                   exit-animation="datepicker-slide-from-top-animation"></app-datepicker-dialog>
planDate: {
                    type: Object,
                    value: {
                        startDate: '2016/12/01',
                        endDate: '2016/12/31'
                    }
                }
};
  • After the page loaded, i can see paper-button showing 2016/12/01 which is correct.
  • Then click the button and dialog opeened it still using today date 2016/08/04
  • The select a date and dialog closed, button still showing date 2016/12/01'

@motss
Copy link
Owner

motss commented Aug 4, 2016

@gusdecool The element works fine just that your code is a bit wrong here and there. After deep investigation to your issue, I found that the code you provided are wrong in the syntax and had no idea why it worked for you (sometimes) and also discovered a small issue while looking into this matter. I already patched it and it worked for your case after that. I will post a demo to show you how to achieve that. Stay tuned~ 😄

@motss
Copy link
Owner

motss commented Aug 4, 2016

@gusdecool Thanks for the use case that I managed to discover bug and got it patched. 👍

@motss
Copy link
Owner

motss commented Aug 4, 2016

@gusdecool Working demo for your use case: http://jsbin.com/xenanotesa/edit?html,output

@gusdecool
Copy link
Author

nice it's work now, thanks for the demo 👍

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

No branches or pull requests

2 participants