Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add date function to stdlib #348

Merged
merged 8 commits into from
Jul 29, 2024
Merged

Conversation

CymDeveloppement
Copy link
Member

this PR add date function to stdlib :
date display a date with a special format with gnu date command format
https://www.gnu.org/software/coreutils/date

now return current timestamp as Num

date_add add days/month/years ... to date date_add("200-01-01", "+122 days")

date_compare compare 2 date (a/b) and return 1 if a is after b, 0 if a and b is the same date, -1 if b is after a
this function can compare 2 date with différent format.

@Mte90 Mte90 self-requested a review July 24, 2024 13:56
Copy link
Member

@Mte90 Mte90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • If you use "Succeded" as output for the test you don't need the output.txt file
  • We aren't using tabs for codestyle but 4 spaces
  • For comments the first letter of the sentence in uppercase
  • A test fails because the CI uses a different timezone

@Mte90
Copy link
Member

Mte90 commented Jul 24, 2024

The timezone now it is the same but the time is different for an hour.

@Mte90 Mte90 requested review from Ph0enixKM and KrosFire July 24, 2024 14:13
@CymDeveloppement CymDeveloppement linked an issue Jul 24, 2024 that may be closed by this pull request
src/std/date.ab Outdated Show resolved Hide resolved
@Mte90
Copy link
Member

Mte90 commented Jul 26, 2024

Can we merge it?

@CymDeveloppement
Copy link
Member Author

CymDeveloppement commented Jul 26, 2024

Can we merge it?

I think so

Copy link
Member

@Ph0enixKM Ph0enixKM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea to add date but this module will change entirely when we add enums where people will be able to easily choose values like day, month etc. This module should be marked as experimental in the documentation as it will evolve very rapidly

src/std/date.ab Outdated Show resolved Hide resolved
@Mte90
Copy link
Member

Mte90 commented Jul 27, 2024

Where we can write that is experimental in the file for the documentation?

@CymDeveloppement
Copy link
Member Author

CymDeveloppement commented Jul 27, 2024

Where we can write that is experimental in the file for the documentation?
@Mte90
maybe just on top of comment like :
/// EXPERIMENTAL

@Mte90
Copy link
Member

Mte90 commented Jul 27, 2024

IF you can add that so we can merge this PR

@Mte90 Mte90 merged commit d38bcc9 into amber-lang:master Jul 29, 2024
1 check passed
@CymDeveloppement CymDeveloppement deleted the date_functions branch July 29, 2024 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Date/timestamp functions
5 participants