purescript-datetime icon indicating copy to clipboard operation
purescript-datetime copied to clipboard

Non FFI version of purescript-datetime

Open Cmdv opened this issue 3 years ago • 6 comments

After a brief chat with @garyb here, it was mentioned that ideally purescript-datetime could actually be 100% pure Purescript.

Would the idea be to reproduce these specs here?

As a starting point I assume I'd need to replace:

var createDate = function (y, m, d) {
  var date = new Date(Date.UTC(y, m, d));
  if (y >= 0 && y < 100) {
    date.setUTCFullYear(y);
  }
  return date;
};

So there would be no leaning on the use of JS's implementation? This is assuming I'm not barking up the wrong tree, if that is the case what might one need to look at?

edit: I'm also looking at Haskell's Date.Time for guidance.

Cmdv avatar Sep 22 '20 10:09 Cmdv