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

Enhancement: Fix date formats on notification emails when a form with date/time fields is submitted #8120

Closed
joseorsini opened this issue Sep 3, 2015 · 2 comments

Comments

@joseorsini
Copy link
Contributor

Reproduced in 3.2.4. Steps:

  1. Create a Form with a Text field, Date field, Date and Time field and Time field. Add a valid email address to the Form Email
  2. Add form to a Frontend page.
  3. For Date and Date and Time fields, you can add any value to it. For the Time field, set 4:00 PM as its value.
  4. Submit the form.

Notes:

  1. The date format is inconsistent for some fields, and this is mostly caused by Dojo and how it handles Date/DateTime/Time fields in the form. For Date and Time fields, Once a value is placed in this field type on a form, there are other two hidden fields created in background, and they separately save the date and time, although with a different format: yyyy-MM-dd and HH:mm, instead of yyyy/MM/dd hh:mm:ss a. Notification email sends the field's value with yyyy/MM/dd hh:mm:ss a as its date format, but the other two additional hidden fields are included in the notification email as well. This may cause confusion among email recipients.
  2. The Time field's value is sent with 24hr (HH:mm:ss) instead of 12hr format (hh:mm:ss a).
  3. The Date field format is slightly different than Date and Time: it's yyyy-MM-dd. We should replace it to yyyy/MM/dd so it matches with the Date format from a Date and Time field and it would be more easy to read and consistent for email recipients.

Depending on the Country/Region, dates and times could be read differently (see https://en.wikipedia.org/wiki/Date_format_by_country for more details), so we should allow users to customize the Date/Time format of these fields when a notification email is being built. A config property like

NOTIFICATION_EMAIL_DATE_TIME_FORMAT=yyyy/MM/dd hh:mm:ss a
NOTIFICATION_EMAIL_DATE_FORMAT=yyyy/MM/dd
NOTIFICATION_EMAIL_TIME_FORMAT=hh:mm:ss a

Could be added to the codebase and, upon fields verification when an email is built, we could send a default value in case the config is not set (again, using the suggested values from above).

@joseorsini
Copy link
Contributor Author

Screenshots:

  • Form definition
    screen shot 2015-09-03 at 12 33 35 pm
  • Frontend form
    screen shot 2015-09-03 at 12 34 42 pm
  • Notification email
    screen shot 2015-09-03 at 12 35 49 pm

@stale
Copy link

stale bot commented Sep 30, 2019

This issue has been automatically marked as stale because it has not had activity within the past 90 days. It will be closed in 30 days no further activity occurs. Thank you.

@stale stale bot added the wontfix label Sep 30, 2019
@stale stale bot closed this as completed Oct 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants