extend date.constructor

I am in the process of converting a desktop app to iOS. I am finding that emulating some of the missing functions is the fastest way to convert but I’m having a problem with date.constructors. The desktop version allows dim d as new date(olddate) or dim d as date = new date (olddate) to duplicate a date - but the constructor is not available in iOS.

So by extending I try to create a new constructor

Sub constructor(extends d as date, copyDate as date)
d.Constructor(copyDate.SecondsFrom1970, copyDate.TimeZone)
End Sub

…but I just get the message: “There is more than one item with this name and it is not clear to which this refers.”

What am I doing wrong?

I have an entire custom class that emulates all features of the XOJO Date class for iOS
Problem is… its in SWIFT

you cant addd a constructor using extends

I guess that would explain it… shame… more work.

Subclass the Xojo.Core.Date and add a Constructor that way.

Ah, yes, thank you Kem.

Then you have to remember to use YOUR date not the system one
Why not rename it “clone” or “copyOf” or something like that (which is more descriptive of what you’re actually doing)
Then do

Function Clone(extends d as  Xojo.core.date) as Xojo.core.date
   return new xojo.core.date(d.SecondsFrom1970, d.TimeZone)
End Sub