Dashboard balance warning timestamp UTC JavaScript

When I setup the insifficient blanace alerts, it semes to be expecting a UTC timestamp to display the “Last Updated” string, but then the local time conversion isn’t happening. JavaScript that was broken or went missing? Anyone else using this feature?

Intl.DateTimeFormat().resolvedOptions().timeZone
'America/New_York'

JSON
{"version":1,"timestamp":1768249698,"config":...

Renders in the browser as

<time datetime="2026-01-12T20:22:18Z" data-local="time" data-format="%Y/%m/%d at %l:%M%p">2026/01/12 at  8:22PM</time>

That HTML renders server side. I.e., in ruby, not on the client side in javascript. Is your sever’s localtime UTC?

Nope and I’ve never noticed it elsewhere on the dashboard. Job session card timestamps show EST.

$ date
Mon Jan 12 19:07:14 EST 2026

$ ruby -e 'puts Time.now;'
2026-01-12 19:10:05 -0500

OK - did you supply your own localization for balance_reload_message_html?

Yes, I’ve been modifying the localization for all four balance_ values. I just tested removing all of the customizations and restarting the dashboard, and it still seems to be appearing in UTC.

<time datetime="2026-01-13T14:50:29Z" data-local="time" data-format="%Y/%m/%d at %l:%M%p">2026/01/13 at  2:50PM</time>

OK - looking at the gem’s documentation this is expected for it to be UTC. Apparently we’re supposed to translate it on the client side to a different time zone.

1 Like

Yeah, it seemed like there was some kind of JavaScript component missing to it. Any reason not to do this in server-side in Ruby, similar to the session cards?

On a somewhat related note, I’m finding it difficult to get the actual alert text formatting customized in a way that is useful to match our accounting system. Seems like it would be easier if there was just a single html localization field that I could use with the variable tokens.

You can override any page - so if you wanted you could provide a different partial for _insufficient_balance_resource.html.erb.

My guess is it wasn’[quote=“hansen-m, post:7, topic:4705”]
Any reason not to do this in server-side in Ruby, similar to the session cards?
[/quote]

It is done server side, but my guess is is that it was just done and we just never realized it was UTC.

I ended up adding this partial and just omitting the local_time call.

<div class="alert-heading h4">
  <%= t('dashboard.balance_warning_prefix_html', units_balance: balance.units_balance, unit: balance.unit) %>
  <strong><%= balance.project_type %> <%= balance.balance_object %></strong>
</div>
<p><%= balance.to_s %>. <%= t('dashboard.balance_additional_message', balanace_units: balance.balanace_units, unit: balance.unit) %></p>
<p class="text-muted d-none d-md-block">
  <%= t('dashboard.balance_reload_message_html', last_update: balance.updated_at.getlocal.strftime('%Y/%m/%d at %l:%M%p')).html_safe %>
</p>

Thanks for the reminder on this. I’ve created this ticket upstream to change it from UTC on our side.