appsmith: [Bug]: Unpredictable movements of the dates in the date picker included in the table widget; are decreased by 1 day.

Is there an existing issue for this?

  • I have searched the existing issues

Description

Currently, in a table widget, if we try to add a new row and one of the fields is a date picker, it will decrease the selected date by one day. For example, if I select 2023-07-09, it will select 2023-07-08. The strange thing about this bug is that it only occurs in a European time zone; it doesn’t happen in another time zone.

Steps To Reproduce

I tried to replicate the issue unsuccessfully. However, the user shared the application where the problem can be seen. Make sure you are in a European time zone.

For more context and videos, you can see the conversation with the user: https://app.frontapp.com/open/cnv_11b2uw5o?key=6Ow9FD3H6U0PYcJY6lBMKc7w2XqkaAaq

Public Sample App

https://app.appsmith.com/app/bug-date-simple/page1-64a7d393af033d5dcc48b2e6

Environment

Production

Issue video log

https://www.loom.com/share/405cc2a2c6aa416ea7245721dc33dc76?sid=398a0130-dc0e-4bea-8be4-44fc7b0c83e8

Version

Cloud: Appsmith v1.9.25-SNAPSHOT

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 2
  • Comments: 15 (5 by maintainers)

Most upvoted comments

@somangshu @keyurparalkar @dilippitchika

I have been faced with this issue and was pointed here form the discord support channel

I think I have since found a solution although it is early days

I was finding that, no matter what I tried, when using moment that the utc time was always applied, adding 1hour onto the time. The issue only occurred with the Date/Time input, when viewing in a text widget, the date/time was able to be formatted correctly

I have since added the https://cdn.jsdelivr.net/npm/date-and-time@3.0.2/date-and-time.min.js library and am using {{date.parse(appsmith.store.group.datetime, 'YYYY-MM-DD HH:mm:ss [GMT]' )}}

This seems to have sorted the issue but time will tell

@amareshvarma the app might not be accessible to you. You will have to repro this on your own end.

I can also add you to the app if you want

Hello can you please use - {{moment.utc(DatePicker1.formattedDate)}} instead of using {{Datepicker1.selectedDate}} for now?

@somangshu you are right, this confusion is coming quite often because selectedDate is taking the user’s selection and internally using the locale to convert to UTC time.

Our options are

  1. Add a new property in the datepicker which is a toggle to remove selectedDate UTC formatting
  2. Add a new reference property called {{Datepicker1.localDate}} which will just give the selected date without any utc logic applied to it.

Please suggest if there are other options.

I have invited support@appsmith.com and made that app public so you should now have access otherwise I don’t know how I can give you access