Skip to content

Commit d82ce31

Browse files
committed
🔨 chore: update date format
1 parent 9a917b9 commit d82ce31

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

package-lock.json

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"license": "MIT",
1313
"dependencies": {
1414
"axios": "^0.21.1",
15+
"date-fns": "^2.19.0",
1516
"dotenv": "^8.2.0"
1617
},
1718
"devDependencies": {

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import "dotenv/config";
22
import axios from "axios";
3+
import format from "date-fns/format";
34
import { WakatimeItem } from "./interfaces";
45

56
const GITHUB_API_URL = "https://api.github.com";
@@ -58,7 +59,7 @@ async function init() {
5859
const age = calculateAge("07/21/2005");
5960

6061
const total = await getWakatimeTotalTime();
61-
const today = new Date().toLocaleDateString();
62+
const today = format(Date.now(), "yyyy-MM-dd")
6263
const bioMessage = `${age}y/o programmer and student - Frontend focused web dev. Coded Today (${today}): ${total}`;
6364

6465
await updateBio(bioMessage);

0 commit comments

Comments
 (0)