mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-13 10:42:16 +01:00
add trial expiry day countdown to billing banner
This commit is contained in:
committed by
Constantin Graf
parent
d211e962f5
commit
845f0d19d8
@@ -1,4 +1,5 @@
|
||||
import { usePage } from '@inertiajs/vue3';
|
||||
import { getDayJsInstance } from '@/packages/ui/src/utils/time';
|
||||
|
||||
export function isBillingActivated() {
|
||||
const page = usePage<{
|
||||
@@ -17,6 +18,22 @@ export function isInTrial() {
|
||||
|
||||
return page.props.billing.has_trial;
|
||||
}
|
||||
|
||||
export function daysLeftInTrial() {
|
||||
const page = usePage<{
|
||||
billing: {
|
||||
trial_until: string;
|
||||
};
|
||||
}>();
|
||||
|
||||
return (
|
||||
getDayJsInstance()(page.props.billing.trial_until).diff(
|
||||
getDayJsInstance()(),
|
||||
'days'
|
||||
) + 1
|
||||
);
|
||||
}
|
||||
|
||||
export function isBlocked() {
|
||||
const page = usePage<{
|
||||
billing: {
|
||||
|
||||
Reference in New Issue
Block a user