Setting dates relative to other dates
I need to be able to dynamically set dates. For example, one day prior to the system date or one day after the date displayed in another date widget. It is too cumbersome to try to parse out the slashes and manually replace the date especially since each month has a different number of days.
Dear Rechell,
I've just realised that by oversight we didn't reply this post. Can you elaborate more on what you mean? Are you using the date widget?
Best,
Sonia Durán
Dear Rechell,
I've just realised that by oversight we didn't reply this post. Can you elaborate more on what you mean? Are you using the date widget?
Best,
Sonia Durán
I mean doing "date arithmetic". For example set the value of a date box to one day after today's date.
I mean doing "date arithmetic". For example set the value of a date box to one day after today's date.
Hi Rechell,
I know you would prefer the ability to do date arithmetic to be built into JIM, but in the event that it is not and it is critical that you are able to do it, you can accomplish it using the expressions I've built in the attached prototype (see screenshots below). Download the file and change the extension from .rar to .vp. It is not compressed.
I'll warn you, the expressions to achieve what you are hoping to do are pretty elaborate, but I believe them to be accurate. They are based upon formulas using Julian Day Count integers, described here:
https://quasar.as.utexas.edu/BillInfo/JulianDatesG.html
Should you decide to dig into it, I've tried to mimic the formulas (variables, etc.) as they appear on the linked site to make them easier to follow/decipher.
Note to Justinmind developers: If these formulas were converted into functions (eg. JDC() for Julian Day Count and GCD() for Gregorian Calendar Date), date arithmetic would be possible. Also, as you can see by the expressions, it would be huge step forward in simplifying them if a truncate function was available. The work around makes the expressions a great deal larger.
Cheers!!
.
P. S. The file I originally attached was the wrong one. I noticed it shortly after (20 minutes or so) and replaced it with the correct file. As long as you have the file "date_calculations_prototype.rar", you have the correct one. ("date_difference_calculation_prototype.rar" is the incorrect one)
Hi Rechell,
I know you would prefer the ability to do date arithmetic to be built into JIM, but in the event that it is not and it is critical that you are able to do it, you can accomplish it using the expressions I've built in the attached prototype (see screenshots below). Download the file and change the extension from .rar to .vp. It is not compressed.
I'll warn you, the expressions to achieve what you are hoping to do are pretty elaborate, but I believe them to be accurate. They are based upon formulas using Julian Day Count integers, described here:
https://quasar.as.utexas.edu/BillInfo/JulianDatesG.html
Should you decide to dig into it, I've tried to mimic the formulas (variables, etc.) as they appear on the linked site to make them easier to follow/decipher.
Note to Justinmind developers: If these formulas were converted into functions (eg. JDC() for Julian Day Count and GCD() for Gregorian Calendar Date), date arithmetic would be possible. Also, as you can see by the expressions, it would be huge step forward in simplifying them if a truncate function was available. The work around makes the expressions a great deal larger.
Cheers!!
.
P. S. The file I originally attached was the wrong one. I noticed it shortly after (20 minutes or so) and replaced it with the correct file. As long as you have the file "date_calculations_prototype.rar", you have the correct one. ("date_difference_calculation_prototype.rar" is the incorrect one)
Hi there,
Thank you so much for your contribution @eggroll! :) I hope this helps @RechellSchwartz.
Best,
Sonia Durán
Hi there,
Thank you so much for your contribution @eggroll! :) I hope this helps @RechellSchwartz.
Best,
Sonia Durán
Thank you, @egroll. What you did is very impressive. However, I do feel date arithmetic is standard functionality that should be incorporated into Justinmind. Any chance of seeing this in a future release?
Thank you, @egroll. What you did is very impressive. However, I do feel date arithmetic is standard functionality that should be incorporated into Justinmind. Any chance of seeing this in a future release?
Replies have been locked on this page!