@gadicc - your solution looks good, but I don't know what it would look like inside the module source. "connect" is usually declared as a function member of 'exports' and I suspect declaring the date constructor as "exports.connect = function.." might stop it being a date constructor...
Ah, someone at my work has said that if I declare the date as normal
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
@gadicc - your solution looks good, but I don't know what it would look like inside the module source. "connect" is usually declared as a function member of 'exports' and I suspect declaring the date constructor as "exports.connect = function.." might stop it being a date constructor...
Ah, someone at my work has said that if I declare the date as normal
Date = function ()...
Then put a line like this
exports.Date=Date;
Then I can use it like this
Date = require('date').Date;
var d1 = new Date();
I'll test this approach soon...
Martin
Martin