File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ GITHUB="<github_token>"
15
15
GITHUB_USERNAME="<github_username>"
16
16
17
17
DESCRIPTION="Your description"
18
+ BIRTHDAY="2000-01-01" // Birthday date year/month/day
18
19
19
20
WAKATIME_URL="https://wakatime.com/share"
20
21
WAKATIME_GLOBAL="/@AndcoolSystems/c20041f4-a965-47c3-ac36-7234e622a980.json" // WakaTime Global stats
Original file line number Diff line number Diff line change @@ -84,9 +84,16 @@ export class WidgetService {
84
84
{ }
85
85
) ;
86
86
87
+ const startDate = new Date ( process . env . BIRTHDAY ) ;
88
+ const endDate = new Date ( ) ;
89
+ const diffMs = endDate . getTime ( ) - startDate . getTime ( ) ;
90
+ const diffDays = diffMs / ( 1000 * 60 * 60 * 24 ) ;
91
+ const daysInYear = 365.2425 ;
92
+
87
93
json = {
88
94
name : github_data ?. data ?. user ?. name ,
89
95
description : process . env . DESCRIPTION ,
96
+ age : diffDays / daysInYear ,
90
97
github : {
91
98
followers : github_data ?. data ?. user ?. followers ?. totalCount ,
92
99
total_stars : github_data ?. total_stars ,
You can’t perform that action at this time.
0 commit comments