Non FFI version of purescript-datetime

Open
#79 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
24/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Domain
backend

Research direction

The issue proposes replacing JavaScript FFI date handling with a fully pure PureScript implementation and points to the existing createDate snippet, the ECMAScript Date specification, and Haskell's Data.Time as references. Start by reading the current date implementation and the linked specification to determine the scope and behavior to reproduce. Done would mean agreeing on and implementing a complete pure replacement; the issue does not identify tests or a narrower target.

Written by the indexing model from the issue text.

Description

type: enhancement

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.

Dominant language
PureScript
Stars
51
Forks
48
Avg merge
2d 23h
Merged PRs (30d)
1

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from purescript/purescript-datetime

All issues in purescript/purescript-datetime

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.