-
Notifications
You must be signed in to change notification settings - Fork 123
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
base: main
Are you sure you want to change the base?
Conversation
Hey Philipp, this is my first try to add the Coptic Calendar to js-joda. |
Obviously the PR failed. I don't know how to get those tests running |
There was a problem hiding this 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', () => { |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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; | ||
} | ||
} |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 ?
No description provided.