Skip to content

Commit 47515e9

Browse files
authored
prettify sale date format (#25)
1 parent cd5e2b6 commit 47515e9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.github/workflows/release.yml

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ permissions:
1111

1212
env:
1313
WORKING_DIRECTORY: bot
14+
1415
defaults:
1516
run:
1617
working-directory: ./bot

bot/src/epic_games.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ async function check_store() {
2020
const games = res.data.data.Catalog.searchStore.elements
2121
var game_list = []
2222
games.forEach((game) => {
23-
console.log(game)
2423
var skip = true
2524
const title = game.title
2625
console.log(game.title)
@@ -50,11 +49,15 @@ async function check_store() {
5049
// 12 Days of Christmas it seems to be using this check
5150
if (game.promotions.promotionalOffers[0] != null) {
5251
end_date = game.promotions.promotionalOffers[0].promotionalOffers[0].endDate
52+
date = new Date(Date.parse(end_date))
53+
end_date = date.toLocaleString('en-us')
5354
skip = false
5455
}
5556
if (game.promotions.upcomingPromotionalOffers[0] != null) {
5657
if (game.promotions.upcomingPromotionalOffers[0].promotionalOffers[0] != null) {
5758
start_date = game.promotions.upcomingPromotionalOffers[0].promotionalOffers[0].startDate
59+
date = new Date(Date.parse(start_date))
60+
start_date = date.toLocaleString('en-us')
5861
skip = false
5962
}
6063
}

0 commit comments

Comments
 (0)