Skip to content

Commit 468ac58

Browse files
committed
feat: update time style
1 parent f97df85 commit 468ac58

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scripts/src/updateWorkflow.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,21 @@ export async function updateWorkflowNumber() {
3939
const workflowDetails = await getLatestWorkflow();
4040
const count = workflowDetails.count;
4141
const timeStamp = new Date(workflowDetails.timeStamp);
42+
const time = new Date(
43+
timeStamp.getTime() + 5.5 * 60 * 60 * 1000
44+
).toLocaleString("en-US", {
45+
timeZone: "Asia/Kolkata",
46+
dateStyle: "medium",
47+
timeStyle: "short",
48+
}) +" IST";
4249

4350
const readmeContent = readFileSync(READMEFILE_PATH, "utf-8");
4451

4552
const updatedContent = readmeContent.replace(
4653
/(?<=<!--START_SECTION:workflows-update-->\n)[\s\S]*(?=\n<!--END_SECTION:workflows-update-->)/,
4754
`\n<p align="center">
4855
This <i>README</i> file is refreshed <b>every 24 hours</b>!<br/>
49-
Last refresh: <b>${timeStamp.toUTCString().split(",")[1]}</b><br/>
56+
Last refresh: <b>${time}</b><br/>
5057
Number of workflows: <b>${count}</b><br/><br/>
5158
Made with ❤️ by Pulkit
5259
</p>\n`

0 commit comments

Comments
 (0)