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

[Bug] close time panel #531

Closed
orionchikby opened this issue Oct 16, 2020 · 13 comments
Closed

[Bug] close time panel #531

orionchikby opened this issue Oct 16, 2020 · 13 comments

Comments

@orionchikby
Copy link

orionchikby commented Oct 16, 2020

Vue2-datepicker version: "vue2-datepicker": "^3.6.2",
Vue version: "vue": "2.6.10",
Browser: edge chromium, google chrome, safari, Firefox (Mac OS , windows, iPad, tablet)
Steps to reproduce
click title

Reproduction Link or Source Code
https://mengxiong10.github.io/vue2-datepicker/index.html#ControlTimePanel

Expected behavior
close time panel

Actual behavior

if control showTimePanell then click title not work

Screenshot (15)

@orionchikby orionchikby changed the title [Bug] [Bug] close time panel Oct 16, 2020
@mengxiong10
Copy link
Owner

Becase you should change value of showTimePanel to control it.

@orionchikby
Copy link
Author

orionchikby commented Nov 11, 2020

I do
And when I click on the date, nothing happens. Maybe there is an event that can be intercepted?

<date-picker
                v-model="dateTs"
                type="datetime"
                value-type="format"
                :disabled-date="notBeforeTodayAndAfterFinishTime"
                :show-time-panel="showDatePickerTimePanel"
                @pick="skipDateRange"
                @open="onDatePickerOpened()"
                :open.sync="openDatePicker"
                :lang="lang"
                :title-format="userFormat"
                :format="userFormat"
                :show-second="false"
                :minute-step="5"
                :input-class='inputCssClass'
            >
<i slot="icon-calendar">
                    <i class="far fa-calendar-alt"></i>
                </i>
                <template v-slot:footer>
                    <button v-if="showDatePickerTimePanel" class="mx-btn mx-btn-text pull-left" @click="showDatePickerTimePanel=false">
                        select date
                    </button>
                    <button v-else class="mx-btn mx-btn-text pull-left" @click="showDatePickerTimePanel=true">
                        select time
                    </button>
                    <button class="mx-btn mx-btn-text" @click="openDatePicker=false">
                        OK
                    </button>
                </template>
            </date-picker>

-----------


 methods: {
            onDatePickerOpened() {
                this.showDatePickerTimePanel = false
            },
            skipDateRange(date) {
                this.showDatePickerTimePanel = true
            },

@mengxiong10
Copy link
Owner

You can listen event change to know what you click.

@orionchikby
Copy link
Author

https://jsfiddle.net/orion_by/syzfcxvw/2/
I don’t understand how this will help me?
Click events don't arrive.
Change events will not give what I need.
Can you help figure out the problem?

@mengxiong10
Copy link
Owner

Do you mean you need back to date picker when you click the title ?
image

@orionchikby
Copy link
Author

Yes

@mengxiong10
Copy link
Owner

I'll add an event in next version, then this code (:show-time-panel.sync) will work.

@orionchikby
Copy link
Author

Thank you so much

I think I found another bug
If russian language selected and format is DD MMM YYYY HH:mm -> Date not selectable

https://jsfiddle.net/orion_by/31h84ty5/8/

@mengxiong10
Copy link
Owner

@orionchikby thanks, It's a date parse bug. You can set value-type="date" to avoid the bug.

@orionchikby
Copy link
Author

thanks
i tried this before
https://jsfiddle.net/orion_by/31h84ty5/14/
If i set value-type="date" then input does not show default value
no matter what language is set.

@mengxiong10
Copy link
Owner

mengxiong10 commented Nov 17, 2020

@orionchikby If the value-type is 'date', the value of v-model should be a Date not a string. Change the dateTs to new Date(2020,10,27, 10,22)

@orionchikby
Copy link
Author

@mengxiong10 thanks. I'll try

@mengxiong10
Copy link
Owner

mengxiong10 commented Nov 18, 2020

v3.8.0 added the show-time-panel.sync and fixed the parse error.

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