Date format in dbr

Hi,

I’m building an HTML from scratch but the Date fields are not formatting the date strings as expected:

I took the format example from this forum topic: Date picker not updating cube - #2 by plim

Am I referencing the date-option correctly?

Thanks!

Joao

Hi @jpaulo,

That looks alright. Was it consistently doing the mm/dd/yyyy format if you pick other dates? How about the Browser Cache? Have you tried to clear that?

Can you double check on the DOM that the HTML rendered already has that option passed in? If you right click on that element on Chrome, and select “Inspect Element”, can you help verify that you can see this:

image

If not, then clearing the cache should help resolve that.

Otherwise, try to put it out of that patternfly directive(?) and check if it is still the same.


Paul

Hi Paul,

Thanks for the response.

Yes. Inspecting shows tm1-date-option="{format:‘dd/MMM/yyyy’}" or any other content that I fill in. Regardless, the filed keeps showing the default format.

Joao

Hi @jpaulo,

The default format is actually yyyy-mm-dd. There could be some possible hook happening. Can you try it out on a pure Canvas page?

Have tried it out with both (the first one I did not pass anything which would now retrieve the default in Canvas):

<tm1-ui-dbr tm1-instance="dev" tm1-cube="System Info" tm1-elements="Budget Year,Comment" tm1-date-option="{}"></tm1-ui-dbr>

<tm1-ui-dbr tm1-instance="dev" tm1-cube="System Info" tm1-elements="Server Time,Comment" tm1-date-option="{format:'mm-yyyy'}"></tm1-ui-dbr>

And both looks alright:

image

What version of Canvas are you in?


Paul

Hi @plim

I’m in fact using Apliqo-UX. Applying the empty option “{}” , I get the format mm/dd/yyyy.

For now, what we’re doing is merge, in an HTML form, the tm1-ui-dbr form numbers and common text fields and uib-datepicker for dates. Then we pass the dates as parameters to a process.

Thanks for the help.

Cheers,

Joao

Hi @jpaulo,

It is possible that it is being overridden somewhere. Have you tried it out on a pure Canvas application?


Paul

Hi @plim,

Sorry for the late response…

Yes, in pure Canvas it works fine:
Datepicker

Hi @jpaulo,

Thanks for that confirmation!

Given the behaviour, it would be best for now to check this with the Apliqo UX team.


Paul

Use tm1-date-option=’{dateFormat:“dd-MM-yy”}’

or any combination of

  • d - day of month (no leading zero)
  • dd - day of month (two digit)
  • o - day of year (no leading zeros)
  • oo - day of year (three digit)
  • D - day name short
  • DD - day name long
  • m - month of year (no leading zero)
  • mm - month of year (two digit)
  • M - month name short
  • MM - month name long
  • y - year (two digit)
  • yy - year (four digit)
  • @ - Unix timestamp (ms since 01/01/1970)
  • ! - Windows ticks (100ns since 01/01/0001)
  • ‘…’ - literal text
  • ‘’ - single quote
  • anything else - literal text
1 Like