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

Day of Week Manipulations #14

Closed
SimonRice opened this issue Jun 13, 2015 · 5 comments
Closed

Day of Week Manipulations #14

SimonRice opened this issue Jun 13, 2015 · 5 comments

Comments

@SimonRice
Copy link
Contributor

First of all, thank you for the quality library! My date manipulations in Swift not only look more pleasant to read, but they even sound better when reading them to my workmates!

This is just a small addition suggestion - one feature I've had to extend on my own is getting at the beginning and end of the week, based on the current calendar's start of week. I did this in my own codebase by making a public/internal property-based version of firstWeekDate() in an extension of NSDate. I know there is firstDayOfWeek & lastDayOfWeek, but the start/end of the week may not be in the same month (or year!). You could take this suggestion further by adding a function that returns the next / previous occurring day of the week - e.g., next(.Monday) or last(.Tuesday).

@malcommac
Copy link
Owner

Hi @SimonRice,
Thank you for your report and compliments :-) so you are asking about making a public version of the firstWeekDate() method, right? (and add another lastWeekDate())

next/last(.DayOfTheWeek) could be a great addition. Have you already some code about that your it's a feature request?

@SimonRice
Copy link
Contributor Author

That would be correct :) in my example, I in fact continued with your naming convention by using beginningOfWeek and endOfWeek.

I haven't got any example of next/last day of week - but I'm more than happy to have a go.

@malcommac
Copy link
Owner

Yeah, I think it could be a great addition and if you have time to work on it now I'll be more than happy to merge your work into the main branch of the library. Otherwise I'll need some time to add these features due to some work commitments into the following two weeks.

@SimonRice
Copy link
Contributor Author

I know that feeling very well - most of my contributions are in my spare time (or in silly hours)!

I'll see what I can do within the next 2 weeks - I'd be more than happy to chip in with a Swift project**.

** Besides deleting .DS_Store files ;)

@malcommac
Copy link
Owner

I'm planning to add it later this week. Meanwhile I'll close this issue; discussion can continue here at issue #45

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

No branches or pull requests

2 participants