Skip to content
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

Feature: date.format #2886

Closed
rawkode opened this issue Jun 3, 2020 · 1 comment
Closed

Feature: date.format #2886

rawkode opened this issue Jun 3, 2020 · 1 comment

Comments

@rawkode
Copy link

rawkode commented Jun 3, 2020

I'd like the ability to date a Date value and format it as a string for table outputs.

Currently I am using something like so:

        { r with date: 
          if v.myWindowPeriod == "1y" then string(v: date.year(t: experimental.subDuration(d: 1h, from: r._stop)))
          else if v.myWindowPeriod == "3mo" then string(v: date.year(t: experimental.subDuration(d: 1h, from: r._stop))) + " Q" + string(v: date.quarter(t: experimental.subDuration(d: 1h, from: r._stop)))
          else if v.myWindowPeriod == "1mo" then string(v: date.year(t: experimental.subDuration(d: 1h, from: r._stop))) + " M" + string(v: date.month(t: experimental.subDuration(d: 1h, from: r._stop)))
          else if v.myWindowPeriod == "1w" then string(v: date.year(t: experimental.subDuration(d: 1h, from: r._stop))) + " W" + string(v: date.week(t: experimental.subDuration(d: 1h, from: r._stop)))
          else "0"
        }
Copy link

This issue has had no recent activity and will be closed soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant