250
Views
23
Comments
Solved
[OutSystems Data Grid] How to display blank instead of `1900-01-01
data-grid-reactive
Reactive icon
Forge component by Platform Maintenance
Application Type
Reactive
Service Studio Version
11.14.5 (Build 57418)
Platform Version
11.9.1.23962

Hi,

Does anyone how to display a blank text instead of 01-01-1900 in Data Grid Reactive cell?
This is an read only field and I am using DateTime Column block from Data Grid Reactive.

For example, first record is showing 31-12-1899 ``11:00 PM (after timezone offset) but I want it to show a blank text.

Regards,
Soon

Solution

Sounds like the issue is on ArrangeData server action.

Once changed it to JSONSerailize all the NULL date has been displayed correctly.


If using ArrangeData the NULL data has been converted wrong. I am currently in Australia Eastern Daylight Saving (AEDT) time zone and I just recalled the NULL date is working fine back to October last year before daylight saving on.


But for a non-NULL date we can the date time is displayed as expected with same result in both ArrangeData and JSONSerialize.

Does anyone encounter similar issue?



Regards,
Soon

Hi Soon,

are you able to manipulate the data before reaching the datagrid? 

If so you can apply a condition to that field:

  • IF(RecheckSince = NullDate(), "", RecheckSince)

Regards

Champion

Hi Soon

If that's not possible or look complicated you can use Conditional CSS and hide the value using it. 

Please check below links for help -

https://personal-ww5hcsw8.outsystemscloud.com/DataGridSampleReactive/ConditionalFormat?column=1 

https://personal-ww5hcsw8.outsystemscloud.com/DataGridSampleReactive/ConditionalFormatting 

Solution

Sounds like the issue is on ArrangeData server action.

Once changed it to JSONSerailize all the NULL date has been displayed correctly.


If using ArrangeData the NULL data has been converted wrong. I am currently in Australia Eastern Daylight Saving (AEDT) time zone and I just recalled the NULL date is working fine back to October last year before daylight saving on.


But for a non-NULL date we can the date time is displayed as expected with same result in both ArrangeData and JSONSerialize.

Does anyone encounter similar issue?



Regards,
Soon

Just did check on another application using Data Grid Reactive and found it has different behaviour in our Development & Testing environment, each of them are with version 2.6.0 and version 2.6.1


With version 2.6.1

The NULL date is showing 31-12-1899.


With Version 2.6.0

The NULL date is showing blank as expected.


Regards,
Soon

Hello,

We are facing the same issue.

With version 2.6.0, it was possible to display blank instead of `1900-01-01 even in the edit mode.
But with version 2.6.1, we can not display the blank. And in the edit mode, `1900-01-01 is coming back.

Is there a way?


2020-08-05 09-00-16
Gabriel Lundgren

Hello all,


In version 2.6.1 we fixed an issue related with required date/dateTime columns. To display blank dates, please try the
following script on the Grid initialize event:

GridAPI.ColumnManager.GetColumnById($parameters.DateWidgetId)._provider.isRequired = false;        

Hi @Gabriel Lundgren
Tried with the above script on the Grid initialize event but still 1900-01-01 00:00 is displayed.

Am I doing something wrong?

2020-08-05 09-00-16
Gabriel Lundgren

This is weird, I just tested and for me the column is empty. 

Can you send me your sample so I can better understand what's going on?

DataGridSampleReactive_date.oml
2020-08-05 09-00-16
Gabriel Lundgren

Hello,


I think we managed to find the issue. There seems to be a problem with the timezone. We'll add this to our backlog and try to have a fix for it as soon as possible. For now, unfortunately, there is no workaround.


Thank you,

Gabriel Lundgren

Hi. Any progress on this? I have the same issue. More over, it shows UTC+2:30. But I don't know any TZ where it is +2:30 except Russia before 1918. (Server is in UTC). Grid version: 2.6.3

2020-08-05 09-00-16
Gabriel Lundgren

Hello @Dmitrii Lubenskii,


On version 2.7.0, we released some fixes to this. Can you upgrade your Grid version and check if the bug still occurs?

In version 2.6.9: Looks like you are missing datetime data type:

E.g. if you check date column's data type with a js sctipt, you get a text value "1". But should be "4":


OutSystems.GridAPI.GridManager.GetActiveGrid().provider.columns(N).dataType

2020-08-05 09-00-16
Gabriel Lundgren

Sorry, we don't have a version 2.6.9. On our current version, 2.9.0, the scenario you mentioned does not occur.

I have installed  2.9.0 , but still have this issue. Cell displays a datetime stamp as a text: e.g. 2022-08-30T16:07:56.487 and column dataType = 1. Can you help?

2020-08-05 09-00-16
Gabriel Lundgren

I do provide a Json as a data source to the grid. If I get it right that you mean by autogenerated grid.

2020-08-05 09-00-16
Gabriel Lundgren

Can you share the OML of your screen? I think it will be easier this way.

I attached oml.

Thank you for your help.


There is a json string assigned to the Grid.

And if I check in console datetime column: OutSystems.GridAPI.GridManager.GetActiveGrid()._provider.columns[20].dataType

I will get "1".

GridDatetime_Problem.oml

I can do a hack workaround, but column is still text type and not sortable:


Can you please suggest? We have release date very soon.

Thank you in advance. 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.