# Dashboard balance warning timestamp UTC JavaScript

**URL:** <https://discourse.openondemand.org/t/dashboard-balance-warning-timestamp-utc-javascript/4705>\
**Category:** Get Help\
**Tags:** question\
**Created:** [January 12, 2026, 8:33pm UTC](https://discourse.openondemand.org/t/dashboard-balance-warning-timestamp-utc-javascript/4705 "2026-01-12T20:33:07Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![hansen-m](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/hansen-m/32/2200_2.png) [@hansen-m](https://discourse.openondemand.org/u/hansen-m)\
**Post date:** [January 12, 2026, 8:33pm UTC](https://discourse.openondemand.org/t/dashboard-balance-warning-timestamp-utc-javascript/4705/1 "2026-01-12T20:33:07Z")

</div>

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?

> <https://github.com/OSC/ondemand/blob/master/apps/dashboard/app/views/shared/_insufficient_balance_resource.html.erb#L7>

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

```

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

Renders in the browser as

```auto
<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>

```

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [January 12, 2026, 8:43pm UTC](https://discourse.openondemand.org/t/dashboard-balance-warning-timestamp-utc-javascript/4705/2 "2026-01-12T20:43:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hansen-m](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/hansen-m/32/2200_2.png) [@hansen-m](https://discourse.openondemand.org/u/hansen-m)\
**Post date:** [January 13, 2026, 12:12am UTC](https://discourse.openondemand.org/t/dashboard-balance-warning-timestamp-utc-javascript/4705/3 "2026-01-13T00:12:14Z")

</div>

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

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

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

```

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [January 13, 2026, 2:28pm UTC](https://discourse.openondemand.org/t/dashboard-balance-warning-timestamp-utc-javascript/4705/4 "2026-01-13T14:28:58Z")

</div>

OK - did you supply your own localization for `balance_reload_message_html`?

---

<div class="post-metadata">

**Author:** ![hansen-m](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/hansen-m/32/2200_2.png) [@hansen-m](https://discourse.openondemand.org/u/hansen-m)\
**Post date:** [January 13, 2026, 2:55pm UTC](https://discourse.openondemand.org/t/dashboard-balance-warning-timestamp-utc-javascript/4705/5 "2026-01-13T14:55:45Z")

</div>

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.

```auto
<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>

```

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [January 13, 2026, 3:07pm UTC](https://discourse.openondemand.org/t/dashboard-balance-warning-timestamp-utc-javascript/4705/6 "2026-01-13T15:07:47Z")

</div>

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.

> **[GitHub - basecamp/local\_time: Rails engine for cache-friendly, client-side local...](https://github.com/basecamp/local_time/tree/main)**
>
> main

---

<div class="post-metadata">

**Author:** ![hansen-m](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/hansen-m/32/2200_2.png) [@hansen-m](https://discourse.openondemand.org/u/hansen-m)\
**Post date:** [January 13, 2026, 4:31pm UTC](https://discourse.openondemand.org/t/dashboard-balance-warning-timestamp-utc-javascript/4705/7 "2026-01-13T16:31:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [January 13, 2026, 5:02pm UTC](https://discourse.openondemand.org/t/dashboard-balance-warning-timestamp-utc-javascript/4705/8 "2026-01-13T17:02:42Z")

</div>

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

> **[partials - Customizations — Open OnDemand 4.0.0 documentation](https://osc.github.io/ood-documentation/latest/customizations.html#overriding-pages)**
>
> Tip

> [@hansen-m](#):
>
> Any reason not to do this in server-side in Ruby, similar to the session cards?

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.

---

<div class="post-metadata">

**Author:** ![hansen-m](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/hansen-m/32/2200_2.png) [@hansen-m](https://discourse.openondemand.org/u/hansen-m)\
**Post date:** [January 27, 2026, 5:20pm UTC](https://discourse.openondemand.org/t/dashboard-balance-warning-timestamp-utc-javascript/4705/9 "2026-01-27T17:20:42Z")

</div>

I ended up adding this partial and just omitting the local\_time call.

```ruby
<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>

```

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [January 27, 2026, 5:25pm UTC](https://discourse.openondemand.org/t/dashboard-balance-warning-timestamp-utc-javascript/4705/10 "2026-01-27T17:25:38Z")

</div>

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

> <https://github.com/OSC/ondemand/issues/5018>
>
> From discourse - https://discourse.openondemand.org/t/dashboard-balance-warning-…timestamp-utc-javascript/4705/9
> 
> The last updated time for balance warnings is in UTC. Looking at the \`local-time\` gem this is to be expected to be cache friendly. Apparently there's supposed to be javascript to convert it to local time.
> 
> Instead we should just use the local time on the server as there is no global cache in this context. Everyone has their own PUN so caching in some other layer just isn't a thing for OnDemand.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/b/bae70bd0ed39a3ae769c2108155f4cb3e9da8385.png) [@system](https://discourse.openondemand.org/u/system)\
**Post date:** [July 26, 2026, 5:26pm UTC](https://discourse.openondemand.org/t/dashboard-balance-warning-timestamp-utc-javascript/4705/11 "2026-07-26T17:26:22Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
