ElemeFE / element

A Vue.js 2.0 UI Toolkit for Web
https://element.eleme.io/
MIT License
54.12k stars 14.64k forks source link

[Bug Report] DatePicker 'default-time'-attribute isnt working correctly #10752

Closed frostySeasoning closed 6 years ago

frostySeasoning commented 6 years ago

Element UI version

2.3.4

OS/Browsers version

Windows 10 / Chrome / Firefox

Vue version

2.5.17-beta.0

Reproduction Link

https://jsfiddle.net/7x4k1d16/2/

Steps to reproduce

  1. set the 'default-time'-attribute
  2. enter the daterange

(if the jsfiddle link isnt working just use the fiddle of your example under https://element.eleme.io/#/en-US/component/date-picker#default-time-for-start-date-and-end-date)

What is Expected?

e.g. :default-time="['00:00:00', '23:59:59']" will lead to [ "2018-04-04T00:00:00.000Z", "2018-04-05T23:59:59.000Z" ] when the daterange is set to '2018-04-04 - 2018-04-05'

What is actually happening?

The example will lead to [ "2018-04-03T22:00:00.000Z", "2018-04-05T21:59:59.000Z" ]. This seems to happen because the default-default-time is '22:00:00' and the difference of 24:00:00 to the set default-time is subtracted.

Leopoldthecoder commented 6 years ago

DatePicker always returns date in your time zone. https://jsfiddle.net/7x4k1d16/8/

frostySeasoning commented 6 years ago

Thank you. Forgot about that.