Skip to content

Commit

Permalink
Merge branch 'dev' into billing-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
milo-hyben committed Jan 31, 2024
2 parents 9eb3625 + 6134af9 commit 629a998
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion web/src/pages/billing/BillingInvoiceMonthCost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ const BillingCurrentCost = () => {
const year = invoiceMonth.substring(0, 4)
const month = invoiceMonth.substring(4, 6)
let nextYear = year
let nextMonth = (parseInt(month, 10) + 1).toString()
let nextMonth = (parseInt(month, 10) + 1).toString().padStart(2, '0')
if (month === '12') {
nextYear = (parseInt(year, 10) + 1).toString()
nextMonth = '01'
Expand Down
5 changes: 3 additions & 2 deletions web/src/shared/components/Graphs/DonutChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,15 @@ export const DonutChart: React.FC<IDonutChartProps> = ({ data, maxSlices, colors
const margin = 15
const radius = Math.min(width, height) / 2 - margin

// keep order of the slices
// keep order of the slices, declare custom sort function to keep order of slices as passed in
// by default pie function starts from index 1 and sorts by value
const pieFnc = pie()
.value((d) => d.value)
.sort((a) => {
if (typeof a === 'object' && a.type === 'inc') {
return 1
}
return -1
return 0 // works both on Safari and Firefox, any other value will break one of them
})
const data_ready = pieFnc(data)
const innerRadius = radius / 1.75 // inner radius of pie, in pixels (non-zero for donut)
Expand Down

0 comments on commit 629a998

Please sign in to comment.