billingdates

package
v0.41.4-rc.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package billingdates decides which calendar date a billing instant is shown as (B8, DA's Pro-flip blocker).

One instant used to show two dates: Stripe's Portal and emails state the UTC calendar date ("Cancels Nov 6, 2027") while our cards formatted the same instant in the viewer's zone ("ends November 5, 2027" in Pacific). Matching the processor is the point, so a period that Stripe, our own founding grant, a trial or a grant defines is shown as its UTC calendar date, as a plain date with no zone conversion and no "UTC" suffix. An Apple period is shown by Apple in the device's zone, so ours stays an instant the client formats on the device.

Index

Constants

View Source
const (
	// UTCDate: the plan_*_date fields carry the UTC calendar date of each instant; show them as dates, with no zone conversion.
	UTCDate = "utc_date"
	// Instant: Apple's own UI shows device-local dates, so the instants are formatted on the device and no *_date field is set.
	Instant = "instant"
)

The two bases of /api/auth/me's plan_date_basis.

Variables

This section is empty.

Functions

func BasisFor

func BasisFor(source string) string

BasisFor is the basis for a plan source (stripe, apple, founding, grant, trial, billing_off, demo): "" for no source.

func Date

func Date(t *time.Time) *string

Date is the UTC calendar date of t as "YYYY-MM-DD" (the zone t carries is irrelevant), nil for nil.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL