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

It shows wrong format #210

Closed
JanathDilshan opened this issue Jul 25, 2016 · 3 comments
Closed

It shows wrong format #210

JanathDilshan opened this issue Jul 25, 2016 · 3 comments
Labels

Comments

@JanathDilshan
Copy link

It shows "01 months 06 weeks 03 days". It's not possible. It should be 2 months and 2 weeks. What's the problem here?

@THPubs
Copy link

THPubs commented Jul 25, 2016

Looks like it's calculating total weeks. Is it possible to add Weeks left (taking away months) like you have done with %d - Days left (taking away weeks)? 👍

@samwilliscreative
Copy link

I've been using this code to calculate the weeks left. It uses the total number of days to complete the month and divides by 7, then strips out the decimal places.

var weeks = parseInt((event.strftime('%n') / 7));

I then insert the value into the html like so:

$(this).html(event.strftime('<span>%m</span> Months <span>' + weeks + '</span> weeks <span>%d</span> Days'));

@hilios hilios mentioned this issue Aug 3, 2016
11 tasks
@hilios
Copy link
Owner

hilios commented Aug 3, 2016

This may have a imprecision. There is some month that have less than 4 weeks?

@hilios hilios closed this as completed in 7dfc6a5 Aug 3, 2016
@hilios hilios added the feature label Aug 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants