Skip to content

Commit

Permalink
feat: output percentages by part of day in view
Browse files Browse the repository at this point in the history
  • Loading branch information
freddyhm committed Sep 14, 2023
1 parent 9f11875 commit fd9a459
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ app.get('/', async (req, res) => {
const partOfDayPercentageOfCommits = await getPartOfDayPercentageOfCommits();

res.render("home", {
pageTitle: "MyRepoStats"
pageTitle: "MyRepoStats",
partOfDayPercentageOfCommits
})
})

Expand Down
8 changes: 4 additions & 4 deletions views/home.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<h1>MyRepoStats</h1>
</header>
<h2>When are commits typically made during the day?</h2>
<h3>Morning: 10%</h3>
<h3>Afternoon: 60%</h3>
<h3>Evening: 20%</h3>
<h3>Night: 10%</h3>
<h3>Morning: {{#if partOfDayPercentageOfCommits.Morning}}{{partOfDayPercentageOfCommits.Morning}}{{else}}0{{/if}}%</h3>
<h3>Afternoon: {{#if partOfDayPercentageOfCommits.Afternoon}}{{partOfDayPercentageOfCommits.Afternoon}}{{else}}0{{/if}}%</h3>
<h3>Evening: {{#if partOfDayPercentageOfCommits.Evening}}{{partOfDayPercentageOfCommits.Evening}}{{else}}0{{/if}}%</h3>
<h3>Night: {{#if partOfDayPercentageOfCommits.Night}}{{partOfDayPercentageOfCommits.Night}}{{else}}0{{/if}}%</h3>

0 comments on commit fd9a459

Please sign in to comment.