Thanks to visit codestin.com
Credit goes to github.com

Skip to content

implemented coptic calendar #752

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mamitry
Copy link

@mamitry mamitry commented Jan 14, 2025

No description provided.

@pithu
Copy link
Member

pithu commented Jan 14, 2025

Hello @mamitry amazing, thanks a lot for contributing !

Its the implementation for Issue #585, i guess. Could you add some words in the description of the PR ?

Give me some time to review it.

@mamitry
Copy link
Author

mamitry commented Jan 14, 2025

Hey Philipp, this is my first try to add the Coptic Calendar to js-joda.

@mamitry
Copy link
Author

mamitry commented Jan 14, 2025

Obviously the PR failed. I don't know how to get those tests running

Copy link
Member

@pithu pithu left a comment

Choose a reason for hiding this comment

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

There might be more issues, i commented the most obvious for now.


describe('CopticDate', () => {
describe('Basic Creation', () => {
test('should create a valid date', () => {
Copy link
Member

Choose a reason for hiding this comment

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

Needs to be it instead of test

constructor(prolepticYear, month, day) {
this.prolepticYear = prolepticYear;
this.month = month;
this.day = day;
Copy link
Member

Choose a reason for hiding this comment

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

getter are required for all 3 parameters prolepticYear(), month() and day()

* This calendar system is primarily used in Christian Egypt.
* Dates are aligned such that 0001-01-01 (Coptic) is 0284-08-29 (ISO).
*/
class CopticDate {
Copy link
Member

Choose a reason for hiding this comment

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

extends ChronoLocalDate missing here

// Define static property after class declaration
CopticDate.EPOCH_DAY_DIFFERENCE = 574971 + 40587; // MJD values

export default CopticDate;
Copy link
Member

Choose a reason for hiding this comment

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

you must export the class instead of specifying a default export

/**
* A date in the Coptic calendar system.
*/
export class CopticDate {
Copy link
Member

Choose a reason for hiding this comment

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

Ups, why you defined a duplicate here ?


return copticEpochDay - CopticChronology.EPOCH_DAY_DIFFERENCE;
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Last empty line missing here

/**
* An era in the Coptic calendar system.
*/
export class CopticEra {
Copy link
Member

Choose a reason for hiding this comment

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

the class should go to an separate file

// Initialize static properties
CopticChronology._INSTANCE = new CopticChronology();
CopticChronology.INSTANCE = CopticChronology._INSTANCE;
CopticChronology.EPOCH_DAY_DIFFERENCE = 574971 + 40587; // MJD values
Copy link
Member

Choose a reason for hiding this comment

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

Any reason why you defined this one not in CopticDate as in the threeten upstream project ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants