CAD Forums > CAD General

text field with a day counter or "Return by Date"

(1/2) > >>

jlogan02:
I have a stamp with a date in it. The user fills out the date the drawing should be returned, which is always +14 days from when they inserted the stamp & published the drawing. I'd like to create a field that reads todays date and add 14 days to it. Does anyone know if this is possible in a text field?

In excel it would be "=(TODAY()+14)". I just don't know of a diesel equivalent.

Lee Mac:
Try the following DIESEL expression (change the formatting to suit):

--- Code - Auto/Visual Lisp: ---$(edtime,$(+,$(getvar,date),14),"dd mon yyyy")

jlogan02:

--- Quote from: Lee Mac on September 08, 2021, 05:41:34 PM ---Try the following DIESEL expression (change the formatting to suit):

--- Code - Auto/Visual Lisp: ---$(edtime,$(+,$(getvar,date),14),"dd mon yyyy")
--- End quote ---


--- Code - Auto/Visual Lisp: ---$(+, $(edtime, $(getvar,date), 14) I had tried this while waiting and got nowhere.

Will try your method.

jlogan02:
Not quite the result I was expecting. I edited to this...


--- Code - Auto/Visual Lisp: ---$(edtime,$(+,$(getvar,date),14),"MM-DD-yyyy")
With the intention of getting a 09-22-2021 result. However, my result turned out to be 10-22-2021

JohnK:

--- Quote from: jlogan02 on September 08, 2021, 06:12:45 PM ---Not quite the result I was expecting. I edited to this...


--- Code - Auto/Visual Lisp: ---$(edtime,$(+,$(getvar,date),14),"MM-DD-yyyy")
With the intention of getting a 09-22-2021 result. However, my result turned out to be 10-22-2021

--- End quote ---

I think you want:

--- Code - Auto/Visual Lisp: ---$(edtime,$(+,$(getvar,date),14),MO-DD-YYYY) 

Navigation

[0] Message Index

[#] Next page

Go to full version