Skip to content

Commit

Permalink
fix: Price since publication widget displaying only finite number. Ge…
Browse files Browse the repository at this point in the history
…tting correct publication price by extending form/to args
  • Loading branch information
DmitriVanGuard committed Jan 24, 2023
1 parent 2b1df95 commit 0db8943
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/api/insights/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { ONE_DAY_IN_MS } from 'webkit/utils/dates'

function optimizePublicationPriceDate(publishedAt) {
const date = new Date(publishedAt)
const minutes = date.getMinutes()
date.setMinutes(minutes < 30 ? 30 : 60)
date.setHours(date.getHours() + 1)
return date.toISOString()
}

Expand Down
5 changes: 4 additions & 1 deletion src/components/PriceSincePublication.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@
/>
</Chart>
</div>
<Change {change} class="$style.change" />

{#if Number.isFinite(change)}
<Change {change} class="$style.change" />
{/if}
</div>
{/if}

Expand Down

0 comments on commit 0db8943

Please sign in to comment.