# Javascript-calculated custom field: Dealing with two dates

**URL:** <https://community.eazybi.com/t/javascript-calculated-custom-field-dealing-with-two-dates/18975>\
**Category:** Questions & Answers\
**Tags:** javascript, eazybi\
**Created:** [October 22, 2024, 10:24pm UTC](https://community.eazybi.com/t/javascript-calculated-custom-field-dealing-with-two-dates/18975 "2024-10-22T22:24:30Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![zane.baranovska](https://community.eazybi.com/user_avatar/community.eazybi.com/zane.baranovska/32/7209_2.png) [@zane.baranovska](https://community.eazybi.com/u/zane.baranovska)\
**Post date:** [October 24, 2024, 1:06pm UTC](https://community.eazybi.com/t/javascript-calculated-custom-field-dealing-with-two-dates/18975/2 "2024-10-24T13:06:24Z")

</div>

Hi @Kyung_Park,

In Import options, you can create a new calculated field ([Account specific calculated fields](https://docs.eazybi.com/eazybi/data-import/data-from-jira/javascript-calculated-custom-fields/account-specific-calculated-fields)).

1. Chose the data type **“Sting”** as results would be tests Yes / No

2. Select the field for data import as **“Dimension”** so you can group and filter data by end results.

3. In the **JavaScript** field, enter the code to compare dates. The logic would be tist to check if issieu has both dates and only then compare them. The code might look like this:

4. I recommend **testing** the code on individual issues, one for each outcome.

On the Cloud and starting eazyBI version 8.0 (which will be released soon), an **AI assistant** can help you write JavaScript code.  
Here are more details on how to work with eazyBI AI assistants: [AI Assistants](https://docs.eazybi.com/eazybi/analyze-and-visualize/ai-assistants)

Best,  
Zane / [support@eazyBI.com](mailto:support@eazyBI.com)

---

_[View the full topic](https://community.eazybi.com/t/javascript-calculated-custom-field-dealing-with-two-dates/18975)._
