Skip to content

feat: factory function 'fromMilliseconds' added - #24

Merged
FatulM merged 2 commits into
FatulM:masterfrom
ali77gh:master
Aug 4, 2024
Merged

FatulM merged 2 commits into
FatulM:masterfrom
ali77gh:master

Conversation

@ali77gh

@ali77gh ali77gh commented Jul 30, 2024

Copy link
Copy Markdown
Contributor

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

@FatulM FatulM left a comment •

Copy link
Copy Markdown
Owner

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

ali77gh commented Jul 31, 2024

Copy link
Copy Markdown
Contributor Author

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.

@FatulM FatulM left a comment

Copy link
Copy Markdown
Owner

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
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