未验证 提交 de1007fc 编写于 作者: T Tim Reichen 提交者: GitHub

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

上级 015fa0bd
......@@ -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
......
......@@ -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
......
......@@ -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: () => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册