Skip to content

Commit 29cbac7

Browse files
AchoArnoldCopilot
andcommitted
feat(web): show full billing period range and remove Total Cost column
- Usage history now shows 'May 12, 2026 - June 13, 2026' format - Removed Total Cost column from usage history table - Added billingPeriodDate filter for long date format - Updated billingPeriod filter to show date range Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 4292241 commit 29cbac7

2 files changed

Lines changed: 30 additions & 10 deletions

File tree

web/pages/billing/index.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,6 @@
386386
Received
387387
<span v-if="$vuetify.breakpoint.lgAndUp">Messages</span>
388388
</th>
389-
<th class="text-right">
390-
<span v-if="$vuetify.breakpoint.lgAndUp">Total</span> Cost
391-
</th>
392389
</tr>
393390
</thead>
394391
<tbody>
@@ -398,17 +395,20 @@
398395
:key="billingUsage.id"
399396
>
400397
<td>
401-
{{ billingUsage.start_timestamp | billingPeriod }}
398+
{{
399+
billingUsage.start_timestamp | billingPeriodDate
400+
}}
401+
402+
{{
403+
billingUsage.end_timestamp | billingPeriodDate
404+
}}
402405
</td>
403406
<td>
404407
{{ billingUsage.sent_messages | decimal }}
405408
</td>
406409
<td>
407410
{{ billingUsage.received_messages }}
408411
</td>
409-
<td class="text-right font-weight-bold">
410-
{{ billingUsage.total_cost | money }}
411-
</td>
412412
</tr>
413413
</tbody>
414414
</template>

web/plugins/filters.ts

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,32 @@ Vue.filter('decimal', (value: string): string => {
4545
})
4646

4747
Vue.filter('billingPeriod', (value: string): string => {
48-
const options = {
48+
const startDate = new Date(value)
49+
const options: Intl.DateTimeFormatOptions = {
50+
month: 'short',
51+
day: 'numeric',
52+
}
53+
const optionsWithYear: Intl.DateTimeFormatOptions = {
54+
month: 'short',
55+
day: 'numeric',
4956
year: 'numeric',
57+
}
58+
const start = startDate.toLocaleDateString('en-US', options)
59+
const endDate = new Date(startDate)
60+
endDate.setMonth(endDate.getMonth() + 1)
61+
endDate.setDate(endDate.getDate() - 1)
62+
const end = endDate.toLocaleDateString('en-US', optionsWithYear)
63+
return `${start}${end}`
64+
})
65+
66+
Vue.filter('billingPeriodDate', (value: string): string => {
67+
const date = new Date(value)
68+
const options: Intl.DateTimeFormatOptions = {
69+
day: 'numeric',
5070
month: 'long',
71+
year: 'numeric',
5172
}
52-
// @ts-ignore
53-
return new Date(value).toLocaleDateString('en-US', options)
73+
return date.toLocaleDateString('en-US', options)
5474
})
5575

5676
Vue.filter('humanizeTime', (value: string): string => {

0 commit comments

Comments
 (0)