nick-keller / react-datasheet-grid

An Airtable-like / Excel-like component to create beautiful spreadsheets.
MIT License
1.81k stars 171 forks source link

Date pasting issue. #223

Closed devourer3 closed 1 year ago

devourer3 commented 1 year ago

Hi Keller,

I'm using the library well every time.

I found one minor bug and reported it.

For example, paste 2022. 12. 13 in Korea, it will be displayed as 2022. 12. 12.

The cause of this problem is assumed to be an error that occurs when the DateColumn or IsoDateColumn does not add the GMT value to the time when "new Date('2022. 12. 13')" is executed in the pasteValue.

On the other hand, enter "new Date('2022-12-13')", the GMT value is added to the time and displayed as a normal date.

Thus, If there is a value which is '2022. 12. 13' OR '2022/12/13', in the pasteValue function, please replace all of them in 2022-12-13 format.

To Summarize,

  1. yyyy-mm-dd(O)
  2. yyyy. mm. dd(X) -> replace yyyy-mm-dd
  3. yyyy/mm/dd(X) -> replace yyyy-mm-dd

If you'd like, I'll proceed with a pull request.

Please refer to the video.

https://user-images.githubusercontent.com/30230285/207255096-e95ed0a8-c2bf-42fc-aa18-da259938b06d.mov

스크린샷 2022-12-13 오후 4 29 37

The picture below is the time display when creating a Date object for each DateFormat.

nick-keller commented 1 year ago

Feel free to send a PR @devourer3 !