1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-22 15:06:54 -05:00

refactor(std/datetime): remove currentDayOfYear (#7059)

This commit is contained in:
Tim Reichen 2020-08-18 22:30:09 +02:00 committed by GitHub
parent 015fa0bd41
commit de1007fc6a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 23 deletions

View file

@ -64,19 +64,14 @@ format(new Date(2019, 0, 20), "'today:' yyyy-MM-dd") // output : "today: 2019-01
...
```
### dayOfYear / currentDayOfYear
### dayOfYear
- `dayOfYear()` - Returns the number of the day in the year.
- `currentDayOfYear()` - Returns the number of the current day in the year.
Returns the number of the day in the year.
```ts
import {
dayOfYear,
currentDayOfYear,
} from "https://deno.land/std/datetime/mod.ts";
import { dayOfYear } from "https://deno.land/std/datetime/mod.ts";
dayOfYear(new Date("2019-03-11T03:24:00")); // output: 70
currentDayOfYear(); // output: ** depends on when you run it :) **
```
### weekOfYear

View file

@ -54,14 +54,6 @@ export function dayOfYear(date: Date): number {
return Math.floor(diff / DAY);
}
/**
* Get number of current day in year
* @return Number of current day in year
*/
export function currentDayOfYear(): number {
return dayOfYear(new Date());
}
/**
* Get number of the week in the year (ISO-8601)
* @return Number of the week in year

View file

@ -113,13 +113,6 @@ Deno.test({
},
});
Deno.test({
name: "[std/datetime] currentDayOfYear",
fn: () => {
assertEquals(datetime.dayOfYear(new Date()), datetime.currentDayOfYear());
},
});
Deno.test({
name: "[std/datetime] weekOfYear",
fn: () => {