mingo-app / mingo

Found a bug? have a FR ?
59 stars 3 forks source link

[FR] convert timestamp to readable format #572

Open AlexeySpiridonov opened 1 year ago

AlexeySpiridonov commented 1 year ago

please )

tothradoslav commented 1 year ago

Hi, what exactly do you mean? Are you storing dates as timestamps in DB and would like to handle these as dates?

AlexeySpiridonov commented 1 year ago

Sorry, I should have written in more detail.

It would be great to show UI timestamp as readable date/time

16244324234 [i] - like this, and when hovered over, show the normal date

tothradoslav commented 1 year ago

Ok, are you storing it as a number or a string?

If a number, we would have to be able to guess when it's a date, not a large number.

AlexeySpiridonov commented 1 year ago

The current timestamp is 10 characters long. The range 10**** - 19**** will cover the period from 2004 to 2032.

if let(t)==10 && t>1000000000 && t<1900000000 { showAsDate(t)}

Even if the [i] sign is shown incorrectly somewhere, I think it's okay, and it will be clear why the sign is shown.

But the convenience of using this will add a lot.

You can also check if the name of the field has time substring ;)

tothradoslav commented 1 year ago

OK. We are thinking of a more global solution for such use-cases, because different people will have weird ways of storing data. For example, I'm using a number 20230505 to store a date, where I don't need time granularity and timezones a are a problem.

For such cases, we want to add a custom parsing functionality where you could enter the above condition you wrote and a way to handle such values.

But for starters, we'll just try to implement what you wrote. Thanks!