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

Add support for time zones #1

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

AaronAdelman
Copy link

In incorporating FrenchRepublicanCalendarCore into one of my projects, I realized that it did not support time zones, so I fixed it. I also made it possible to treat Sansculottides as a 13th month in formatted dates, and I was very careful to make sure that the original API was still valid. Enjoy.

Copy link
Owner

@Snowy1803 Snowy1803 left a comment

Choose a reason for hiding this comment

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

I put each comment once, but the naming convention issue and the duplicate initialisers/functions is the same everywhere
Otherwise it looks like a useful feature! Thanks for contributing :)

self.init(base: base, timeZone: nil)
}

init(base: Date = Date(), timeZone: TimeZone?) {
Copy link
Owner

Choose a reason for hiding this comment

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

you could just put a default argument value of nil for timeZone instead of creating another initialiser

}

init(base: Date = Date(), timeZone: TimeZone?) {
var GregorianCalendar: Calendar = Calendar.gregorian
Copy link
Owner

Choose a reason for hiding this comment

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

Use the Swift naming conventions: lowerCamelCase for variables

"Chamerops": "Chamaerops_humilis",
"Épine vinette": "%C3%89pine-vinette",
"Verge d'or": "Solidago"
"Belle de nuit": "Mirabilis_jalapa", "Amaryllis": "Amaryllis_(plante)", "Erable sucré": "%C3%89rable_%C3%A0_sucre", "Perce Neige": "Perce-neige", "Laurier thym": "Viorne_tin", "Thimèle": "Daphn%C3%A9_garou", "Bâton d'or": "Girofl%C3%A9e_des_murailles", "Chamerops": "Chamaerops_humilis", "Épine vinette": "%C3%89pine-vinette", "Verge d'or": "Solidago"
Copy link
Owner

Choose a reason for hiding this comment

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

avoid reformatting code, it's more readable line per line

@Snowy1803 Snowy1803 changed the title Enhanced the capabilities of FrenchRepublicanCalendarCore Add support for time zones Aug 3, 2022
@Snowy1803 Snowy1803 added the enhancement New feature or request label Aug 3, 2022
@AaronAdelman
Copy link
Author

Requested changes have been made. Have run the unit tests just to make sure everything still works.

self.init(romanYear: romanYear, variant: variant, treatSansculottidesAsAMonth: false)
}

public init(romanYear: Bool, variant: Variant, treatSansculottidesAsAMonth: Bool) {
Copy link
Owner

Choose a reason for hiding this comment

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

Could use a default value of false for treatSansculottidesAsAMonth instead of duplicating here too

@Snowy1803
Copy link
Owner

It could also be useful to add unit tests for your additions; it's not necessary for treatSansculottidesAsAMonth, it's pretty straightforward, but the time zone support could be tested

@AaronAdelman
Copy link
Author

AaronAdelman commented Aug 4, 2022 via email

@AaronAdelman
Copy link
Author

AaronAdelman commented Aug 4, 2022 via email

@AaronAdelman
Copy link
Author

AaronAdelman commented Aug 4, 2022 via email

@AaronAdelman
Copy link
Author

AaronAdelman commented Aug 11, 2022 via email

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