Skip to content

Commit 3ccd5c0

Browse files
authored
add date fields (#6)
1 parent 998edc0 commit 3ccd5c0

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

scripts/add_new_contribution_to_yaml.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
given properties, add a new contribution to the contributions.yaml database file.
33
"""
4+
from datetime import datetime
45
import json
56
from sys import argv
67

@@ -37,9 +38,11 @@
3738

3839
# append new contribution with next index
3940
# add status, at top
41+
datetime_today = datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S%z')
4042
contribution = {
4143
'id': max_index + 1,
4244
'status': 'VALID',
45+
'date_added': datetime_today,
4346
}
4447
contribution.update(props)
4548

scripts/fetch_updates.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010

1111
def update_contribution(contribution, props):
12+
datetime_today = datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S%z')
13+
contribution['last_updated'] = datetime_today
14+
1215
# update from online
1316
for field in props.keys():
1417
# process category list
@@ -31,7 +34,7 @@ def log_broken(contribution, msg):
3134
contribution['log'].append(msg)
3235

3336
def process_contribution(contribution):
34-
date_today = datetime.today().strftime('%Y-%m-%d')
37+
date_today = datetime.utcnow().strftime('%Y-%m-%d')
3538
this_version = '0'
3639

3740
if contribution['status'] != 'DEPRECATED':

0 commit comments

Comments
 (0)