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

feat: factory function 'fromMilliseconds' added #24

Merged
merged 2 commits into from
Aug 4, 2024

Conversation

ali77gh
Copy link
Contributor

@ali77gh ali77gh commented Jul 30, 2024

Hello.

By merging this PR users can write shorter code.

Before:

var jdt = Jalali.fromDateTime(DateTime.fromMillisecondsSinceEpoch(milliseconds));

After:

var jdt = Jalali.fromMillisecondsSinceEpoch(milliseconds); 

This factory function added to 'Gregorian' class too.

Tests are included in this PR.

@FatulM FatulM self-assigned this Jul 31, 2024
@FatulM FatulM added the enhancement New feature or request label Jul 31, 2024
Copy link
Owner

@FatulM FatulM left a comment

Choose a reason for hiding this comment

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

Hello,
Thanks for this feature ...

Test cases are failing ...
Check that if this failing is not a problem with my library,
please fix the test cases.

And also please use final instead of var in your test cases.

And also since we are providing milliseconds in factory method:
please add test cases for all fields including seconds and milliseconds.

Thanks.

@ali77gh
Copy link
Contributor Author

ali77gh commented Jul 31, 2024

It was a timezone problem cause of the timezone difference between my laptop and Github server :)
It's fixed now (I guess).
And also do the changes you wanted.

Thanks.

Copy link
Owner

@FatulM FatulM left a comment

Choose a reason for hiding this comment

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

Thanks

@FatulM FatulM merged commit 528a63e into FatulM:master Aug 4, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants