Date Time Culture

hey all,

is it my browser that dont want to change culture, or is it UD that force Culture to US ?
I want time in 24 hours and I want date to be DD MM YYYY.

how do I change culture?
The Server UD run on do have the correct Culture.

Hi @McAndersDK
Exactly which feature is giving you the 12 hour format?
IIS / Azure or running as a Service or merely testing?
Just for fun… add this
New-UDParagraph -Text (get-culture | convertto-json) and see which culture shows up.
When testing on my local computer, it replicated the computer’s settings.

it’s running in IIS.
ah yeah, good point :slight_smile: I will try that.

Ok, so the culture is the correct one.
okey, I figured it out, it seems out-udtabledata are using standard EN-US format for datetime ?
I can atleast force it to use another pattern, althrought it dont work as expected :slight_smile:
tryed this:

Out-UDTableData -Property @(‘Status’,“Last Updated”) -DateTimeFormat (Get-Culture).datetimeformat.FullDateTimePattern

but it will then show:
image

this also got solved by this:

Out-UDTableData -Property @(‘Status’,“Last Updated”) -DateTimeFormat ((Get-Culture).datetimeformat.FullDateTimePattern -replace ‘y’,‘Y’)
not pretty, but do the task :wink:

image

oh… and now to fix why it say 5 of august :wink:

Out-UDTableData -Property @(‘Status’,“Last Updated”) -DateTimeFormat ((Get-Culture).datetimeformat.FullDateTimePattern -replace ‘y’,‘Y’ -replace ‘d’,‘DD’)

image

all good now :wink:

1 Like

Hi again,
Dirty, i like it.

I’ll create an enhancement on the


Would prolly be best if all the locales went default to user locale.

GLHF troubleshooting the lacking updates dude :slight_smile:

Well the best way would be to honor the client browser locale :slight_smile:

Bosen29 github issue link:

@McAndersDK
Fair point, however that sounds like alot of work with the server side processing.
Either that or some fancy clientside javascript viewfilters?

I have no clue! :smiley: I am a powershell guy :wink:

I’ll drink to that!

We’ll see what the gods of UD-Dashboard answers on the Git of Hubs.

Cheers!

but it seems it’s just to include som middleware in dotnet core, and then check on it from the out-udtabledata, out-udgriddata and anyanother outputting code

We could integrate moment (JavaScript library built for handling this) into UD to automatically do this but I’ve also started working on a UDMomement component to render date\times\timezones based on the client’s browser: https://github.com/ironmansoftware/ud-moment

https://momentjs.com/

3 Likes

And the gods have answered!

Are you planning on adding UD-Moment to UD or keeping it as a separate module?

I’m planning on making UD require other modules. So just updating the module manifest to ensure that UDMoment is installed.

This is what I’m trying to achieve: https://github.com/ironmansoftware/universal-dashboard/issues/880

1 Like