Can't implement date picker with date only (no time)

Feature(s) impacted

Date picker

Observed behavior

Our datepicker is set up with DD/mm/YYYY format but the time is always present and send to backend which lead to error with timezone

Expected behavior

Date picker only send date without time to the backend

Failure Logs

No log of failure but we see the wrong date in the back

Context

  • Project name: SERGIC
  • Team name: Gestion
  • Environment name: all
  • Database type: postgresql

thank you

Here are some screenshot :



MicrosoftTeams-image (3)

Hi @mduhez ,

This is the normal behaviour.
Here are two explanations:

  1. The format in your widget has only purpose of displaying the data, either during the edition or during the display, that we received from your db.
  2. Your field loseDate is defined as Date for its type.

If you do not want the timestamp, you must change its type for DateOnly in your model.

module.exports = (sequelize, DataTypes) => {
...
    loseDate: {
      type: DataTypes.DATEONLY,
      ...
    },

Best regards,

Shohan

1 Like