Skip to content

🩹 [Patch]: Guidance for DateTime and TimeSpan attributes #14

@MariusStorhaug

Description

@MariusStorhaug

Describe the change

Describe the change

Standardize the name of all the DateTime and TimeSpan based properties on classes and objects that are managed by the module.

Naming Convention:

  • Specific Point in Time (timestamp)
    • Pattern: EventName + At
    • Examples:
      • ExpiresAt
      • ResetAt
  • Events Before or After a Specific Time (timestamp)
    • Pattern: EventName + Before or EventName + After
    • Examples:
      • ResetBefore
      • ExpiresAfter
  • Time Relative to a Given Time (timespan)
    • In the future
      • Pattern: EventName + In
      • Examples:
        • ExpiresIn
        • ResetIn
    • In the past
      • Pattern: EventName + Ago
      • Examples:
        • ResetAgo
        • ExpiredAgo

Calculation Rules:

  • Ideally, both a timestamp and a timespan should be provided or calculated.
    • If ExpiresAt is provided, calculate ExpiresIn.
    • If ExpiresIn is provided, calculate ExpiresAt.
    • If only one is available, the other should be derived.

Example situations to use this

  • Token Expiration
  • Refresh Token Expiration
  • Rate Limit reset
  • Creation time of a repo (back in time)
  • Update time of a team (back in time)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions