# Erratic behavior with conditional and dates in dashboard indicator

**URL:** <https://forums.losant.com/t/erratic-behavior-with-conditional-and-dates-in-dashboard-indicator/4852>\
**Category:** Bug Report\
**Tags:** dashboard\
**Created:** [December 18, 2022, 10:30pm UTC](https://forums.losant.com/t/erratic-behavior-with-conditional-and-dates-in-dashboard-indicator/4852 "2022-12-18T22:30:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jules\_Huguenin](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/jules_huguenin/32/4031_2.png) [@Jules\_Huguenin](https://forums.losant.com/u/Jules_Huguenin)\
**Post date:** [December 18, 2022, 10:30pm UTC](https://forums.losant.com/t/erratic-behavior-with-conditional-and-dates-in-dashboard-indicator/4852/1 "2022-12-18T22:30:17Z")

</div>

Hi there,  
I have the following conditional rule in a dashboard indicator:  
[edit]: {{value-0}} is the next service date showing in the preview, formatted as follow:

> {{formatDate value-0 ‘DD/MM/YYYY’}}

 ![dashboard design and rule](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/6/671dd109b46bd55797963ce430d1d5d67f71a717.png)

It’s working fine in the preview, and when I test it in the experience I get the expected result:

 ![19-12-2022 11-11-03 am](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/1/18490ef4dd0b6d7e3bfaed6e4e0606a42dac8bae.png)

Now I jump onto another computer and the condition is triggered even though the condition is not met:

 ![Capture d’écran 2022-12-19 à 11.10.39](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/3/35e73c5aec030d2371418fcca1a215b608b3a132.jpeg)

Any idea what could be wrong?

---

<div class="post-metadata">

**Author:** ![Sebastian\_Turner](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/sebastian_turner/32/4024_2.png) [@Sebastian\_Turner](https://forums.losant.com/u/Sebastian_Turner)\
**Post date:** [December 19, 2022, 3:52pm UTC](https://forums.losant.com/t/erratic-behavior-with-conditional-and-dates-in-dashboard-indicator/4852/2 "2022-12-19T15:52:21Z")

</div>

The [{{formatDate}} helper](https://docs.losant.com/workflows/accessing-payload-data/#formatdate-val-formatstr), when used in a dashboard, will use the current browser locale when formatting. The format string follows [Moment.js format](http://momentjs.com/docs/#/displaying/format/) syntax, and the default is `L LTS`.

For example, in your first browser, which appears to be set to English, this will return `12/19/2022 4:00:00 PM`

In your second browser, which appears to be set in French, this would return `19/12/2022 16:00:00`

I believe if you format both dates in the expression to `DD/MM/YYYY`, it will evaluate consistently across multiple locales. If that doesn’t fix the issue, please [DM me the workflow file](https://docs.losant.com/workflows/overview/#exporting-as-a-file) and we’ll troubleshoot further.

---

<div class="post-metadata">

**Author:** ![Jules\_Huguenin](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/jules_huguenin/32/4031_2.png) [@Jules\_Huguenin](https://forums.losant.com/u/Jules_Huguenin)\
**Post date:** [December 22, 2022, 3:12am UTC](https://forums.losant.com/t/erratic-behavior-with-conditional-and-dates-in-dashboard-indicator/4852/3 "2022-12-22T03:12:26Z")

</div>

Thanks @Sebastian_Turner, I have change the formatting to ‘x’ in the condition, it seems to have fixed it.
