Skip to content

Support time.Time instead of int64 for date fields #1972

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 28, 2025

Conversation

mbroshi-stripe
Copy link
Contributor

@mbroshi-stripe mbroshi-stripe commented Jan 22, 2025

Why?

This change supports codegen changes that converts datetime fields from int64 to time.Time as brought up in this issue: #1205.

What?

  • The main change is replacing int64 with time.Time for time fields
  • To support this, form serialization in form.go for time.Time is performed by reflection, since we do not want the default behavior of inspecting into the time.Time struct, rather we just convert it to an int64
  • While I was in there, I also created convenience methods Time, TimeValue, UnixTime and UnixTimeValue to help in creating time.Time and *time.Time parameter fields
  • I also updated unit tests expecting an int64 type

See Also

@mbroshi-stripe mbroshi-stripe changed the title Support time.Time Support time.Time instead of int64 for date fields Jan 23, 2025
@mbroshi-stripe mbroshi-stripe marked this pull request as ready for review January 23, 2025 02:30
@mbroshi-stripe mbroshi-stripe force-pushed the mbroshi/time-dot-time-support branch from aa2e73f to e0418a5 Compare January 23, 2025 17:16
@helenye-stripe
Copy link
Contributor

helenye-stripe commented Jan 23, 2025

:lurk: I think the merge-base for this PR should be the beta branch!

@mbroshi-stripe mbroshi-stripe changed the base branch from master to beta January 23, 2025 17:24
Copy link
Contributor

@jar-stripe jar-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mbroshi-stripe mbroshi-stripe merged commit b7d68c3 into beta Jan 28, 2025
12 checks passed
@mbroshi-stripe mbroshi-stripe deleted the mbroshi/time-dot-time-support branch January 28, 2025 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants