Skip to content

Commit

Permalink
shanaproject: add timezone to date parsing
Browse files Browse the repository at this point in the history
* fix: shanaproject timezone parsing

* fix: add leftovers
  • Loading branch information
Veirt authored Jan 24, 2024
1 parent a183191 commit 5a44754
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions definitions/v7/shanaproject.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ search:
args: ["April", "Apr"]
- name: re_replace
args: ["March", "Mar"]
- name: append
args: " +00:00" # GMT
- name: dateparse
args: "MMM d, yyyy, h:mm tt"
args: "MMM d, yyyy, h:mm tt zzz"
date_abbr:
# May 8, 2022, 6 a.m.
selector: div.release_20:contains(".m."):not(:contains(":"))
Expand All @@ -106,8 +108,10 @@ search:
args: ["April", "Apr"]
- name: re_replace
args: ["March", "Mar"]
- name: append
args: " +00:00" # GMT
- name: dateparse
args: "MMM d, yyyy, h tt"
args: "MMM d, yyyy, h tt zzz"
date_noon:
# Sept. 30, 2022, noon
selector: div.release_20:contains(", noon")
Expand All @@ -127,8 +131,10 @@ search:
args: ["March", "Mar"]
- name: re_replace
args: [" noon", " 12 pm"]
- name: append
args: " +00:00" # GMT
- name: dateparse
args: "MMM d, yyyy, h tt"
args: "MMM d, yyyy, h tt zzz"
date:
text: "{{ if or .Result.date_full .Result.date_abbr .Result.date_noon }}{{ or .Result.date_full .Result.date_abbr .Result.date_noon }}{{ else }}now{{ end }}"
size:
Expand Down

0 comments on commit 5a44754

Please sign in to comment.