更改 trac 查询中的默认日期格式
我有一个 trac (http://trac.edgewall.org/) 错误跟踪系统,我拥有管理员权限,但无法访问实际服务器。我找了一个有权访问服务器的人来安装 iniadmin 插件 (http://trac-hacks.org/wiki/IniAdminPlugin),这样我实际上就可以完成一些工作而不打扰他。
我的问题是,当我进行票证查询时,所有日期都以“3 天前”或“1 个月前”显示。我想要实际的日期。
有人告诉我,执行此操作的方法是更改票证模板,或将默认日期格式从“datesense”更改为“long”。但是,我不知道在哪里执行此操作。
我还需要安装另一个 TracHack 吗?这不可能远程完成吗?
谢谢!
ETA:如果我应该将其转移到更好的表兄弟站点,请告诉我!
I have a trac (http://trac.edgewall.org/) bug tracking system where I have admin priveledges, but no access to the actual server. I got the guy who has access to the server to install the iniadmin plugin (http://trac-hacks.org/wiki/IniAdminPlugin) so I can actually get some stuff done without bothering him.
My problem is that when I do a ticket-query, all of the dates are displayed in terms of "3 days ago" or "1 month ago". I want the actual date.
I've been told that the way to do this is to change the ticket template, or change the default date-format from "datesense" to "long". However, I can't figure out where to do this.
Is there another TracHack I need to get installed? Is it impossible to do this remotely?
thanks!
ETA: If there's a better cousin-site that I this should be moved to, let me know!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要更改票证模板,您需要访问服务器。
如果将鼠标悬停在日期上,您应该会看到一个显示实际日期/时间戳的工具提示。由于此信息已包含在页面的 HTML 中,因此您应该能够使用一些 Javascript 将链接的文本与链接工具提示中的文本交换(我的 javascript 技能很糟糕,或者我会给您一些示例代码) )。您需要服务器访问权限才能在全局范围内进行此更改,但您可以使用 Greasemonkey 等浏览器插件在本地页面上运行 javascript。这样做可以解决您的问题,但其他用户需要在浏览器中执行相同的操作才能获得相同的好处。
To change the ticket template, you do need access to the server.
If you hover the mouse over the date, you should get a tooltip that displays the actual date/timestamp. Since this information is already included in the HTML of the page, you should be able to use some Javascript to swap the text of the link with the text from the link's tooltip (my javascript skills are terrible or I'd give you some sample code). You would need server access to make this change globally, but you can use a browser plugin like Greasemonkey to run the javascript on the page locally. Doing that would fix the problem for you, but other users would need to do the same in their browser to get the same benefit.
根据 this,在 trac 1.0 上是可能的。我在 Trac 1.0.2 的管理面板中没有这样的配置。
但是,如果您有权访问config/trac.ini,则可以将
[trac]
部分中的default_dateinfo_format
设置为absolute
而不是相对
。According to this, it is possible on trac 1.0. I have no such configuration in the admin panel in Trac 1.0.2.
But if you have access to config/trac.ini, you can set
default_dateinfo_format
in[trac]
section toabsolute
instead ofrelative
.