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
"Relative date" to be offered as a Formatting option for date columns in Reports #22371
Comments
@MelsHyrule I wonder if one of the new UI people can work on this one since it's small and self-contained. WDYT? |
@miq-bot assign @MelsHyrule |
@Fryguy we need to have one more option with |
Days since implies a starting point (i..e Days since what), but the data doesn't have that ability. Instead, I said "relative date" as I'd expect the type of output you would see from ActionView::Helpers::DateHelper.time_ago_in_words (e.g. 1 minute ago, 3 hours ago) |
I thought we could tap into those view helpers. Do you remember if we still have this? tapping into the module without requiring creating a new helper e.g.: date_helper = Class.new { include ActionView::Helpers::DateHelper }.new |
Yes, that's exactly how we would do it. You can also do [1] pry(main)> require "action_view"
[2] pry(main)> helper = Module.new { extend ActionView::Helpers::DateHelper }
[3] pry(main)> ls helper
ActionView::Helpers::DateHelper#methods:
date_select distance_of_time_in_words select_date select_day select_minute select_second select_year time_select
datetime_select distance_of_time_in_words_to_now select_datetime select_hour select_month select_time time_ago_in_words time_tag
[4] pry(main)> helper.time_ago_in_words(Time.now + 6000)
=> "about 2 hours" |
cross posting. We have |
In the Formatting tab of a Report, when you have a date column, you'll have the following formatting options;
Basically just how date/time elements (ie. Y, M, D, H, M, S, Z) are shown/arranged. However, in some cases, "relative date" (eg. "days since") is desired rather than a raw date value, no matter how it's formatted.
The text was updated successfully, but these errors were encountered: