[Feature Request] Built-in, English-like handling of Dates

Open
#634 4 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Quiet
Tech stack
javascript
Domain
web-dev

Research direction

Start by reviewing the requested syntax and examples in issue #634. Define completion around supporting date literals, date arithmetic, date-part access, and localized values such as local today; the issue does not name implementation files or tests, so the relevant parser and runtime entry points must first be located.

Written by the indexing model from the issue text.

Description

It would be wonderful if Hyperscript could abstract away the complexity that is dealing with dates in Javascript. I would love to be able to do:

set startDate to 2025-01-29
set finishDate to (startDate + 7 days)

In order to be able to handle all kinds of date calculations, we'd need to have words like:

  • today
  • year, month, day, hour and minutes

That way we'd be able to do:

if the month of birthDate is the month of today then
  if the day of birthDate is the day of today then
    send birthdayGreetings to #welcomeMsg
  end
end

And the complexity of dealing with localised date and time calculations could be abstracted by introducing the keyword local, like this:

set startDate to local today
Dominant language
JavaScript
Stars
3.8k
Forks
171
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

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 bigskysoftware/_hyperscript

All issues in bigskysoftware/_hyperscript

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.