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

datetime/mod.ts: difference incorrect for 'quarters' #3080

Closed
sspilleman opened this issue Jan 2, 2023 · 1 comment · Fixed by #3085
Closed

datetime/mod.ts: difference incorrect for 'quarters' #3080

sspilleman opened this issue Jan 2, 2023 · 1 comment · Fixed by #3085
Labels
bug Something isn't working needs triage

Comments

@sspilleman
Copy link

sspilleman commented Jan 2, 2023

Describe the bug

difference results in incorrect value for 'quarters'

Steps to Reproduce

import { difference } from "https://deno.land/std@0.170.0/datetime/mod.ts";

const date0 = new Date("2018-05-14");
const date1 = new Date("2020-06-13");

console.log(difference(date0, date1));

The output is:

{
  milliseconds: 65750400000,
  seconds: 65750400,
  minutes: 1095840,
  hours: 18264,
  days: 761,
  weeks: 108,
  months: 24,
  quarters: 6,
  years: 2
}

Expected behavior

If the value for months is 24 the value for quarters should be 8 instead of 6.... right?

Environment

  • OS: macOS Ventura 13.1 (22C65)
  • deno version: 1.29.1 (release, aarch64-apple-darwin)
  • std version: 0.170.0
@sspilleman sspilleman added bug Something isn't working needs triage labels Jan 2, 2023
@iuioiua
Copy link
Collaborator

iuioiua commented Jan 2, 2023

I'll fix this in a PR this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants