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

milliseconds truncated for returned occurrences #57

Closed
psnider opened this issue Jun 6, 2014 · 4 comments
Closed

milliseconds truncated for returned occurrences #57

psnider opened this issue Jun 6, 2014 · 4 comments

Comments

@psnider
Copy link

psnider commented Jun 6, 2014

It appears that milliseconds are not carried forward in occurrences.
I know most occurrences don't matter at the level of milliseconds, but it could be useful in some cases, and it definitely allows me to write simpler tests.

The truncation of milliseconds causes my tests to fail:

expected:
"2014-06-08T16:51:13.976Z"
actual:
"2014-06-08T16:51:13.000Z"
@jkbrzt
Copy link
Owner

jkbrzt commented Jun 6, 2014

I looks like we drop them somewhere. And I would guess that it's also root cause for #56, #52.

Can you provide a complete example please?

@psnider
Copy link
Author

psnider commented Jun 6, 2014

Slightly simpler than issue #56, this shows the problem as long as start doesn't happen to be on a whole second:

var rrule = require('rrule');
var RRule = rrule.RRule;
var start = new Date();
var rule = new RRule({
     freq: RRule.HOURLY,
     dtstart: start,
     count: 2
 });
var after = rule.after(start);
after.getTime();

@psnider
Copy link
Author

psnider commented Jun 6, 2014

FWIW, all of my tests use the current time + offsets, such as:

   var start = new Date();

so nearly all of my date objects are not on whole seconds.

@davidgoli
Copy link
Collaborator

Please reopen if you are still experiencing issues.

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