1- How can I add # of days to a specific date, for example adding 100 days to 28/02/2019.
2- How can I calculate # of days between 2 dates, for example how many days between 15/04/2018 and 20/03/2019.
3- How can I get the day of the week from Jason for specific date, for example what is the day of the week on 15/05/2018
4- Is it possible to have Date Picker to choose dates from in Thunkable X same as the one in thunkable classic.
Hi @ali4oman and @bymaho,
If you have a table of how many days are in each month, you can add a number of days to your date by:
if (days left in month) < number, set new date to last day of original month, set number to (number - (days left in month)).
Example: 14 Feb 2019 + 100 days = 28 Feb 2019 + 86 days
For as long as the next month of days is less than number, add 1 month to new date and take that many days away from number
Example: 28 Feb 2019 + 86 days = 31 Mar 2019 + 55 days = 30 Apr 2019 + 25 days
Add the remaining number to your date
Example: 30 Apr 2019 + 25 days = 25 May 2019
Using a method like above, if two dates are in different months the # of days between them is (days between start date and end of month) + (days between end date and start of month) + (number of days in any full months between start date and end date)
If you use the date input in your app, you can see what the day of the month was on a given date. If you want to type a date and get a day of the week, use an API with our Web API component for this purpose.