How to show the remaining days of the month

I would like to automatically show you how many days are left until the month ends.

Grateful for the help!

InkedPrtScr capture_LI22 PrtScr capture

Hey @claudiomarcio.silvei

You could use a bit of Javascript to do this. Download the Toolbox plugin and drag the “Expression” element onto the page. Inside of the property editor, you could input in the following code:

(I got the code from this Stack overflow post: Get number days in a specified month using JavaScript? - Stack Overflow )

That expression will return a number – the total number of days in the month that you pass in (notice how I’m just extracting the current month and year in this example).

Once you have the number of days in the month, it’s just a matter of taking that value and subtracting the current date:

When I preview the app, this is what I get:

Hope this helps!

2 Likes

Hi there, @claudiomarcio.silvei… if you don’t want to use a plugin and Javascript (no offense to Jacob, of course), here is another way to go about it…

Best…
Mike

1 Like

Thank you very much is working, now without wanting to abuse, I’m trying to take the value of this input from the remaining days and divide it by the number of points that are missing, in the example account 55.55 / 16 = 3.4.
The way I did it gives me a higher score 3.7.

Is the way I’m doing this correct? Thank you one more time.2 PrtScr capture_2

Thank you very much for the other alternative, but I think I already got it, just a few hits. Thank you very much anyway.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.