I would like to have a property or constant that is class Date.
I need a New or it doesn’t work, so in order to set this property I have create a dummy property. This also eliminates using a constant.
What am I missing? Or is this the only way?
Create a date property, make it a computed property, and put nothing in get. It will effectively react as a a constant.
Better Put nothing in set
Or make normal property and asssign date in some constructor.
Thanks. I’d tried get and it didn’t work.
I would have dte as a Date
So. What should I be putting in Set?
And what is the format? Can I use Dte = “2017/08/06” or do I have to give it a finer define like Dte.sqldate = “2017-08-06”?
If you have a choice, use the new framework Date. Why? Unlike the classic Date, it’s immutable.
Here is the code with the classic Date:
kMyDate As Computed Property
Get
static d as new Date( 2017, 8, 6 )
return new Date( d )
That will return a new Date object with the same information even if the caller changes it.
Thanks. I’d always seen in the LR “2017/08/06”. I hadn’t thought of putting it as a function.
I also just discovered if I start dte as a property and Convert it to a Computed Property in the IDE it supplies me with everything. Nice work by the designers.
I now have less extra stuff.