54
Views
5
Comments
[OutSystems Data Grid] Datetime Column: data format is not being forced on values different than NullDate
outsystems-data-grid
Reactive icon
Forge asset by OutSystems
Application Type
Reactive

Hello,

I am using the Grid datetime column and I want to force to show full datetime (yyyy/MM/dd hh:mm) when the datetime is not null.

Current behavior:

Line 1: value null - not shoing

Line 2: Time not null (1900-01-01 23:00:00) - showing only the time

Line 3: Date and time not null, displaying according to the format


Line 1 and Line 3 are ok. 

I need to display on Line 2 "1900-01-01 23:00", instead of only showing the time.

Is there any way to achieve this?


Thank you.

UserImage.jpg
vikas sharma
Champion

Hi

As per my understanding this behaviour is right. Because when you show time with 1900-01-01 date so basically it's conveying that specific time of 01 Jan 1900 which is wrong information. As 1900-01-01 is null date actually. So if you have only time then assumption should be like time of current date. So in this case would suggest only show time with current date when you have only time value.

Regards 

2020-08-20 16-46-50
Joao Kuae

Hi @Vikas Sharma 

I don't agree. 

In my understanding, if I explicitly entered the format ("yyyy/MM/dd hh:mm") I would expect to be displayed like this. In addition, the value is not not null anymore, so it should display according to the format.

Thanks.

2023-09-06 07-26-35
Sudip Pal

Hi Joao,

You can do one thing.

1)Make a calculated attribute in your aggregate of type text.

2)Give the logic DateTimeToText(datetime_var)

3)Use this in frontend as a text.


Hope this approach may help you!

Thanks,

Sudip Pal

2020-08-20 16-46-50
Joao Kuae

Hi @Sudip Pal,

Thank you for your idea. This is a workaround, I thought about it but I have the field as editable on the grid. if I change to text it won't be editable as datetime. 

This will be my last option. 

Thank you.

2019-04-09 00-57-55
carl ruhle

Hi João,

I would go with Sudip option.

On the second field, the format is wrong, it has the seconds and that is not the format that you choose.

If the data is null and the time is not null, create the variable with the [1900/current date as Vikas suggested] with the time.

Thanks

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