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

chore: move date-picker out into a library #1172

Merged
merged 7 commits into from Aug 3, 2023

Conversation

mdelez
Copy link
Collaborator

@mdelez mdelez commented Aug 2, 2023

resolves DEV-2502

@mdelez mdelez added refactor Refactor or redesign chore Maintenance and build tasks labels Aug 2, 2023
@mdelez mdelez self-assigned this Aug 2, 2023
@linear
Copy link

linear bot commented Aug 2, 2023

DEV-2502 Move date-picker out into library

We need it in the advanced search so we will need to move it from the app into a library

@mdelez mdelez marked this pull request as ready for review August 2, 2023 13:09
@@ -1,12 +1,10 @@
import { Component, Inject, Input, OnDestroy, OnInit } from '@angular/core';
import {
UntypedFormBuilder,
import {UntypedFormBuilder,
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is here the code convention for multiple imports?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Basically whatever the formatter chooses when you right click > format document

Comment on lines +684 to +701
if (calendar === 'GREGORIAN') {
const calDate = new GregorianCalendarDate(
new CalendarPeriod(date, date)
);
return calDate.daysInMonth(date);
} else if (calendar === 'JULIAN') {
const calDate = new JulianCalendarDate(
new CalendarPeriod(date, date)
);
return calDate.daysInMonth(date);
} else if (calendar === 'ISLAMIC') {
const calDate = new IslamicCalendarDate(
new CalendarPeriod(date, date)
);
return calDate.daysInMonth(date);
} else {
throw Error('Unknown calendar ' + calendar);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not mandatory but in case there are more than two if/ else if lines you can use switch case

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree but I didn't want to change too much of the code. I'd rather refactor it in a separate PR.

Copy link
Collaborator

@Vijeinath Vijeinath left a comment

Choose a reason for hiding this comment

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

LGTM

@mdelez mdelez merged commit ab847bd into main Aug 3, 2023
12 checks passed
@mdelez mdelez deleted the feature/dev-2502-move-date-picker-out-into-library branch August 3, 2023 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Maintenance and build tasks refactor Refactor or redesign
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants