ELTE-Clean/Clean-Administration-Platform

Fix: Time Zone Appears in Task's Expiry Date

Closed this issue · 3 comments

The current tasks table in the database has expiryDate and expiryTime columns. As the name suggests, one is for storing the yy-mm-dd and the other for hh:mm:ss respectively. When we request tasks information, the returned expiryDate will hold the time as well (Default behavior of DB). For this issue, return the layout yy-mm-dd (desired layout to be returned) instead of the layout yy-mm-ddTZ0...... (The returned default text from the Database).

This is not the default behavior according to https://www.postgresql.org/docs/current/datatype-datetime.html

What I meant is that the returned value to the frontend at the moment contains additional data attached to the expiry date value. I don't know actually why it returns that. But a simple solution would be to use new Date(db.expiryDate) and get the year, months, and days (getFullYear()-get....). I think this will work. @the4t4

The issue is because the database Date type is converted to JavaScript Date type which contains the timezone.