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

Value of type 'Moment' has no member 'substract' #5

Closed
AndyDunn opened this issue Jan 15, 2016 · 4 comments
Closed

Value of type 'Moment' has no member 'substract' #5

AndyDunn opened this issue Jan 15, 2016 · 4 comments

Comments

@AndyDunn
Copy link

I'm getting the following error when trying to compile a project including CalendarView:

Value of type 'Moment' has no member 'substract'
/Pods/CalendarView/CalendarView/CalendarView/Classes/ContentView.swift:43:23: 

It happens on this line of ContentView.swift:

var currentDate = date.substract(1, .Months)

It's using Moment version 0.3 and CalendarView 1.1.0.

Any ideas?

@armstrongnate
Copy link
Owner

Yes. It uses SwiftMoment and that framework has been updated. One of the fixes is that it changed substract to subtract. I'll try to get to it this weekend.

@AndyDunn
Copy link
Author

Right, that would make sense. Thanks for letting me know. I'll maybe fix that locally until you have it in place in the library.

@castaldichristian
Copy link

Following up with this issues, I am also getting a few errors when I include the library into the project, beside the error mentioned above I am getting

/Pods/CalendarView/CalendarView/CalendarView/Classes/MonthView.swift:90:38: Type of expression is ambiguous without more context

Thanks

armstrongnate referenced this issue Jan 17, 2016
Finally properly renamed `substract` to `subtract`.
@armstrongnate
Copy link
Owner

Thank you @AndyDunn and @kriskast. I just released 1.1.1 which should fix those errors.

armstrongnate added a commit that referenced this issue Feb 18, 2016
I do wonder if this has something to do with February having
an irregular number of days but the fix would suggest otherwise.

Instead of updating a `currentDay` variable I always calculate the
first day of the week based on the first visible day of the month
because it's less confusing and as long as I set the first date to
the start of the day, the bugs in #7 and #5 are not present which
is good enough for me.

refs #7
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

3 participants