23
Views
7
Comments
Solved
Hi All, DateDifference calculation OnClick event of two datein client side
Question

I need to know how to calculate the difference between two dates after it is clicked by user on the webpage and it should calculate and display immediately after selection ( Using Richwidgets)

Thanks in Advance

UserImage.jpg
Ummul Fazaria
Solution

Ricardo Pereira wrote:

Hi,

You can place a button in your screen with method "Ajax Submit":



In the destination select "New screen action". Inside that action place the assign where you map the variable of your expression to the calculation that you need. 

In the end, place Ajax Refresh of your expression.


Hope this can help.


Best regards,

Ricardo M Pereira

Thank you so much 


2024-11-20 08-28-20
Pedro Marques

Hi Ummul,

You can use the built-in function DiffDays(), to know the difference in days between two dates.

Best regards,

Pedro

2021-03-05 13-56-11
Ricardo Pereira
 
MVP

Hi,


You have built in functions for that:


If you want it to display, place an expression associated to a variable in your screen, and a button or a link associated to an action that calculate the value, assign it to that variable and show it (if traditional web, you need to do ajax refresh to that expression).


Hope this can help.


Best regards,

Ricardo M Pereira

UserImage.jpg
Ummul Fazaria

Ricardo Pereira wrote:

Hi,


You have built in functions for that:


If you want it to display, place an expression associated to a variable in your screen, and a button or a link associated to an action that calculate the value, assign it to that variable and show it (if traditional web, you need to do ajax refresh to that expression).


Hope this can help.


Best regards,

Ricardo M Pereira

I think this way I can do but I need some brief explanation on this because it is a bit confusing on creating button or link . 


2021-03-05 13-56-11
Ricardo Pereira
 
MVP

Hi,

You can place a button in your screen with method "Ajax Submit":



In the destination select "New screen action". Inside that action place the assign where you map the variable of your expression to the calculation that you need. 

In the end, place Ajax Refresh of your expression.


Hope this can help.


Best regards,

Ricardo M Pereira

UserImage.jpg
Ummul Fazaria
Solution

Ricardo Pereira wrote:

Hi,

You can place a button in your screen with method "Ajax Submit":



In the destination select "New screen action". Inside that action place the assign where you map the variable of your expression to the calculation that you need. 

In the end, place Ajax Refresh of your expression.


Hope this can help.


Best regards,

Ricardo M Pereira

Thank you so much 


2025-11-19 06-14-01
Miguel Verdasca
Champion

Hi,

to add all our colleagues mention here, you can check this example page to understand a bit the way that you can do it: How to Calculate Months Difference between Two Dates


You have this functions:

you need to understand what kind of date difference they want to make, and depending on your need to use the functions. If you are unsure of how to do it, on google find numerous pages that help you think of a solution, as I show you on the page I shared with you above.
I hope this information helps you.

Cheers

2021-03-05 13-56-11
Ricardo Pereira
 
MVP

You're welcome.


I'm glad for helped you.


Best regards,

Ricardo M Pereira

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.