appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
33.79k stars 3.64k forks source link

[Bug]-[376]:Datepicker when inside the form widget does not give formatted date #18150

Open danciaclara opened 1 year ago

danciaclara commented 1 year ago

Is there an existing issue for this?

Description

When the Datepicker widget is inside a Form widget, the date when accessed using FormName.data.DataPickerName gives the selected date in ISO format instead of the formatted date.

You can access the formatted date inside the form directly like DatepickerName.formattedDate but users expect the date to be in the formatted version when accessed from within the form instead of having to reformat it manually.

https://community.appsmith.com/t/how-do-i-work-with-datepicker-in-forms/1632 https://discord.com/channels/725602949748752515/760761686549463060/1014444088390582283

Steps To Reproduce

  1. Add a datepicker inside the form widget
  2. Format the date using the Date Format property on the datepicker
  3. Try to access this date outside the form for eg, in a JSObject or in another widget using FormName.data.DataPickerName. You will notice that you get the date in the ISO format and not in the format specified.

Public Sample App

No response

Issue video log

No response

Version

v1.8.7

Front logo Front conversations

dilippitchika commented 1 year ago

@danciaclara most databases support isodate hence the form widget also defaults to the isodate format. This is an enhancement as it's a deliberate choice, not a bug.

dilippitchika commented 1 year ago

Assuming 30% datepicker users need this

Stats

Stat Values
Reach 188
Effort (months) 0.5
dilippitchika commented 1 year ago

Change Add a new field in the datepicker widget to let users define the form behavior