On Tuesday, June 2, 2020 at 4:03:12 AM UTC-4, RjOllos wrote:

> On Monday, June 1, 2020 at 7:44:04 PM UTC-7, Aikido Guy wrote:
>>
>> On Monday, June 1, 2020 at 10:40:30 PM UTC-4, Aikido Guy wrote:
>>>
>>> [ticket-custom]
>>> time1 = time
>>> time1.format = date
>>> time1.label = "Blah (YYYY/MM/DD)
>>> time1.value = 
>>> time1.order = 5
>>>
>>> I've followed all of your advice and am now left with one small (not 
>>> urgent) question. In particular, my original TicketQuery now works (yah!); 
>>> however, instead of having '2018/07/03' shown in my table, I have "*at* 
>>> 2018/07/03".
>>> - Is there a configuration option to control how the time is output? In 
>>> my case, since there are no hours, minutes or seconds, it could be "*on 
>>> *2018/07/03" instead?
>>> - Or maybe there is some kind of option to control a little more the 
>>> format of the date being output? i.e. a way to remove the "at"? or to add 
>>> an "on" etc...
>>>
>>> As a side thought as I am typing... is the "*at* 2018/07/03" supported 
>>> across languages?
>>>
>>
>> I realize that this might be a bit of a rabbit hole... because I can also 
>> imagine using "by end of 2018/07/03"... a lot of duplicated text...
>>
>
> I tested with trunk, but time is also shown for format=date. Did you find 
> otherwise on 1.4-stable?
> https://trac.edgewall.org/ticket/13309
>

I'm pretty sure I typed the right trac.ini config section... I've double 
checked and here it is again (only difference is order from what I typed 
before, and I fixed a typo):

[ticket-custom]
time1 = time
time1.label = Blah (YYYY/MM/DD)
time1.format = date
time1.value = 
time1.order = 5

Looks like I have a different result than you. I have "*at* 2018/07/03" , "
*at* 2019/03/07" etc, with no time values in my custom field column in my 
TracQuery. In my case, the TracQuery is inside a custom plugin that I 
built, but I don't think that should make any difference...

My TicketQuery is something like this:
[[TicketQuery(order=time1,status,time1!=,desc=0,format=table,col=complete|status|time1|summary)]]

- It is ordered by the custom field
- If the custom field is missing then tickets should not be displayed
- It is using the table output format
- The custom field is one of the middle output columns (i.e. it is not the 
first and not the last column)

It is localized. Here is English and French for:
> [[TicketQuery(id=102, format=table, col=time1)]]
>
> [image: Screen Shot 2020-06-02 at 00.50.11.jpg]
>
>
>
>
>
> [image: Screen Shot 2020-06-02 at 00.55.24.jpg]
>
>
>
>
>
Nice ;)

The "at .." is prepared by Chrome.pretty_dateinfo:
>
> https://trac.edgewall.org/browser/tags/trac-1.4.1/trac/web/chrome.py?marks=1258-1263#L1237
>  
> <https://www.google.com/url?q=https%3A%2F%2Ftrac.edgewall.org%2Fbrowser%2Ftags%2Ftrac-1.4.1%2Ftrac%2Fweb%2Fchrome.py%3Fmarks%3D1258-1263%23L1237&sa=D&sntz=1&usg=AFQjCNGSCfODvkW3XGZl4PBsMBt8-LIhbA>
>

Wondering out loud... what makes *dateonly* become True?
   def pretty_dateinfo(date, format=None, *dateonly*=False)

I looked at my Admin panel and default date format is ISO8601 and default 
time format is relative.

You could probably write a small plugin to either monkey-patch that method 
> or change the data in IRequestFilter.post_process_request, but it would be 
> a little tricky.
>
> There's an open ticket to develop and interface that I think would allow 
> modifying the presentation of query results, but not much movement on 
> implementing it.
>
> Or, you could write a report instead and display it with WikiReportMacro:
> https://trac-hacks.org/wiki/WikiReportMacro
>
> You can format the output in SQL to display "by end of ..."
>
> - Ryan
>

This is starting to be a little unmaintainable for me. My original hope was 
for the date "2019/03/29" without anything else attached to it... I do like 
"on 2019/03/29" and "by end of 2019/03/29" and "before 2019/03/29" etc. 
etc. but it seems like a bit of work for me to customize this and/or to get 
the behaviour that the plugin was providing before upgrading.

If there was a way to configure the TracQuery so that the date was not 
annotated that would get me what I need... because I guess what I'm asking 
for is specific to that macro rather than general for all uses of the 
custom field. Alternatively, if there was a trac.ini way to indicate how 
TracQuery should display the custom field that would work for me too. The 
latter would be nice because then I could configure my custom date fields 
to display differently... depending on context. For example, one could be 
"on 2019/03/29" and one could be "before 2019/03/29" and one could be 
simply "2019/03/29" etc. etc.

Maybe something like this:

[ticket-custom]
time1 = time
time1.label = Blah (YYYY/MM/DD)
time1.format = date
time1.tracqueryformat = just a date ;) perhaps a coffee first?? haha
time1.value = 
time1.order = 5

Kindly,
Aikido Guy

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/cc10e33d-1d73-47ea-91e5-17c5f110906e%40googlegroups.com.

Reply via email to