[[PageOutline(2-5,Contents,pullout)]] = Epoch (unix time) field, timezone sensitive == Description '''Note''': in this page, after slashes, descriptions in japanese-KANJI are added. '''This plugin will conflict in Trac 1.1.1. see trac:wiki:/TracDev/Proposals/TracTicketsCustomTimeFields and trac:ticket:1942. ''' This plugin adds the following features: / 以下の二機能があります: 1. [#field Timezone sensitive date&time field.] / 時差を考慮した時刻フィールド 2. [#report Date & time presentation in report.] / 時差を考慮したレポート表示 == Bugs/Feature Requests Existing bugs and feature requests for EpochFieldPlugin are [report:9?COMPONENT=EpochFieldPlugin here].[[BR]] If you have any issues, create a [http://trac-hacks.org/newticket?component=EpochFieldPlugin&owner=matobaa new ticket]. / 不具合報告は[http://trac-hacks.org/newticket?component=EpochFieldPlugin&owner=matobaa こちら]へ。 [[TicketQuery(component=EpochFieldPlugin,group=type,format=progress)]] == Get A Plugin or Source Download the zipped source from [download:epochfieldplugin here].[[BR]] You can check out EpochFieldPlugin from [http://trac-hacks.org/svn/epochfieldplugin here] using Subversion, or [source:epochfieldplugin browse the source] with Trac.[[BR]] 入手は[download:epochfieldplugin zip], [http://trac-hacks.org/svn/epochfieldplugin Subversion], [source:epochfieldplugin Trac]でどうぞ。 == Example / 例 === Epoch field === #field Specify '''format=epoch''' for the custom-field in trac.ini as follows or use CustomFieldAdminPlugin: / trac.ini または CustomFieldAdminPlugin で、カスタムフィールドの format を epoch と指定します: {{{ #!ini [ticket-custom] due = text due.format = epoch }}} This plugin uses [http://keith-wood.name/datetimeEntry.html jquery.datetimeentry.js]. Ctrl-Home to current datetime. / Ctrl-Home で現在日時を入力できます。 [[Image(ticket.png)]] === Epoch report === #report In trac.ini specify field-names you want to translate from epoch to datetime-string in regular-expressions as follows: / trac.ini で 日時表記したいカラム名を正規表現で指定して: {{{ #!ini [epochfield] date_columns = .*_date, .*日付? datetime_columns = .*_datetime, .*日時 time_columns = .*_time, .*時刻 }}} And, for example, create a report query as follows: / たとえば以下のようにSQLを書くと、 {{{ #!sql select id, summary, ticket.time, a.time as accepted_datetime, c.time as closed_datetime, c.author as Closer from ticket left join ( SELECT ticket, author, newvalue AS status, max(time) AS time FROM ticket_change WHERE field = 'status' and newvalue = 'accepted' GROUP BY ticket, newvalue, author ) AS a on (a.ticket = ticket.id and a.status = 'accepted') left join ( SELECT ticket, author, newvalue AS status, max(time) AS time FROM ticket_change WHERE field = 'status' and newvalue = 'closed' GROUP BY ticket, newvalue, author ) AS c on (c.ticket = ticket.id and c.status = 'closed') }}} Then the epoch columns, such as the status change time in the example above, shows as datetime string. / 更新日時といった列を unixtime ではなく日付文字列で表示します。 [[Image(report.png)]] == Recent Changes [[ChangeLog(epochfieldplugin, 3)]] == Author/Contributors '''Author:''' [wiki:matobaa] [[BR]] '''Maintainer:''' [[Maintainer]] [[BR]] '''Contributors:'''