metasfresh / metasfresh-webui-frontend-legacy

metasfresh Webui Frontend
GNU General Public License v2.0
57 stars 35 forks source link

Date/Time widgets fixes #2317

Closed teosarca closed 5 years ago

teosarca commented 5 years ago

Is this a bug or feature request?

What is the current behavior?

Different date and time widgets are handling dates in a weird/incorrect way, so in some cases

Which are the steps to reproduce?

What is the expected or desired behavior?

Expectation:

To accomplish the requirements above, we changed the date/time widget types and also their formats as follows

WidgetType: Date

Local date, without time, without timezone.

Format: yyyy-MM-dd

Example: 2019-04-12

WidgetType: Time

Local time

Format: HH:mm

Example: 13:14

WidgetType: ZonedDateTime

Date+time in a given timezone

Format: yyyy-MM-dd'T'HH:mm:ss.SSSXXX

Important:

WidgetType: Timestamp

Same as ZonedDateTime but this widget is used to display timestamps.

Format: yyyy-MM-dd'T'HH:mm:ss.SSSXXX

Widget: DateTime

No longer present.

teosarca commented 5 years ago

note to developer

To disable the legacy date/time widgets and formats, pls call http://w101.metasfresh.com:8080/rest/api/debug/legacyDateTimeWidgets?enable=false

siemiatj commented 5 years ago

@teosarca the DateWidget still shows up on w101.

teosarca commented 5 years ago

@siemiatj true,

seems i forgot to rename them, so consider

teosarca commented 5 years ago

and btw, on frontend side it would be nice to have those widget types defined as constants. Here is the complete list: https://github.com/metasfresh/metasfresh-webui-api/blob/master/src/main/java/de/metas/ui/web/window/datatypes/json/JSONLayoutWidgetType.java

siemiatj commented 5 years ago

@teosarca as constants in what way and what for ?

  1. I still have DateTime coming from the API even though I've hit this endpoint mentioned https://github.com/metasfresh/metasfresh-webui-frontend/issues/2317#issuecomment-511758878 . Should I consider DateTime as something that's staying, but is not having TZ defined ?

  2. Is Timestamp a widget to edit the timestamp value, or it's only for presentational purposes ? Where can I test that ?

teosarca commented 5 years ago

@siemiatj ping me when u are back.

In meantime i did a quick check


about 1.


about 2.

See https://w101.metasfresh.com:8443/rest/api/window/540163/layout, Created field image

Atm we don't have an editable example but we need to evaluate how much effort would be needed. As a workaround we just need to allow editing from year to minute and just keep the seconds and millis.

note to myself: i've found windows which have timestamp fields by running following SQL:

```sql select w.AD_window_ID, w.Name, t.SeqNo, t.Name, f.Name, uie.* from AD_Column c inner join AD_Field f on f.AD_Column_ID=c.AD_Column_ID inner join AD_Tab t on t.AD_Tab_ID=f.AD_Tab_ID inner join AD_Window w on w.AD_Window_ID=t.AD_Window_ID left outer join AD_UI_Element uie on uie.AD_Field_ID=f.AD_Field_ID where c.ColumnName in ('Created', 'Updated') and f.IsDisplayed='Y' limit 10 ```