├── lang └── en.yml ├── config └── locales │ ├── ja.yml │ └── en.yml ├── test └── test_helper.rb ├── init.rb ├── README.md ├── lib └── absolute_date_helper_patch.rb └── MIT-LICENSE /lang/en.yml: -------------------------------------------------------------------------------- 1 | # English strings go here 2 | my_label: "My label" 3 | -------------------------------------------------------------------------------- /config/locales/ja.yml: -------------------------------------------------------------------------------- 1 | ja: 2 | label_added_absolute_time_by: "%{author} が%{age}に追加" 3 | label_updated_time: "%{value}に更新" 4 | label_updated_time_by: "%{author} が%{age}に更新" 5 | -------------------------------------------------------------------------------- /config/locales/en.yml: -------------------------------------------------------------------------------- 1 | en: 2 | label_added_absolute_time_by: "%{author} added on %{age}" 3 | label_updated_time: "It was last updated on %{value}" 4 | label_updated_time_by: "%{author} updated on %{age}" 5 | -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | # Load the normal Rails helper 2 | require File.expand_path(File.dirname(__FILE__) + '/../../../../test/test_helper') 3 | 4 | # Ensure that we are using the temporary fixture path 5 | Engines::Testing.set_fixture_path 6 | -------------------------------------------------------------------------------- /init.rb: -------------------------------------------------------------------------------- 1 | require 'redmine' 2 | 3 | ApplicationHelper.prepend(AbsoluteDateHelperPatch::ApplicationHelperWithAbsoluteDate) 4 | 5 | Rails.application.config.i18n.load_path += Dir["#{File.dirname(__FILE__)}/config/locales/*.{rb,yml}"] 6 | 7 | Redmine::Plugin.register :redmine_absolute_dates do 8 | name 'Redmine Absolute Dates plugin' 9 | author 'suer' 10 | description 'Display absolute create or update dates ' 11 | version '0.0.4' 12 | url 'https://github.com/suer/redmine_absolute_dates' 13 | author_url 'http://d.hatena.ne.jp/suer' 14 | end 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | absolute_dates 2 | =================== 3 | 4 | [![Code Climate](https://codeclimate.com/github/suer/redmine_absolute_dates.png)](https://codeclimate.com/github/suer/redmine_absolute_dates) 5 | 6 | This Plugin support Japanese environment only! 7 | 8 | 機能 9 | --------------------- 10 | 11 | Redmineのチケットの作成日、更新日はデフォルトでは 12 | 「今日」からの相対的な日時数で表示されます。(...日前など) 13 | 14 | このプラグインはこの日付を通常の日付(yyyy/MM/dd)で表示します。 15 | 16 | インストール 17 | --------------------- 18 | 19 | 1. Redmineのインストールディレクトリ内の vender/plugins/ にて 20 | 21 | $ git clone git://github.com/suer/redmine_absolute_dates.git 22 | 23 | 2. Redmine の再起動 24 | 25 | Redmine Version 26 | --------------------- 27 | 28 | 4.0 以降 29 | 30 | 3.x 以前の Redmine の場合は古いバージョンを使用してください。 31 | 32 | ライセンス 33 | --------------------- 34 | 35 | MITライセンスとします 36 | 37 | -------------------------------------------------------------------------------- /lib/absolute_date_helper_patch.rb: -------------------------------------------------------------------------------- 1 | module AbsoluteDateHelperPatch 2 | module ApplicationHelperWithAbsoluteDate 3 | def authoring(created, author, options={}) 4 | #l(options[:label] || :label_added_time_by, :author => link_to_user(author), :age => time_tag(created)).html_safe 5 | l(options[:label] || :label_added_absolute_time_by, :author => link_to_user(author), :age => time_tag(created)).html_safe 6 | end 7 | 8 | def time_tag(time) 9 | zone = User.current.time_zone 10 | local = zone ? time.in_time_zone(zone) : (time.utc? ? time.localtime : time) 11 | text = format_date(local) 12 | tip_text = format_time(time) 13 | if @project 14 | link_to(text, {:controller => 'activities', :action => 'index', :id => @project, :from => local.to_date}, :title => tip_text).html_safe 15 | else 16 | content_tag('acronym', text, :title => tip_text).html_safe 17 | end 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /MIT-LICENSE: -------------------------------------------------------------------------------- 1 | == MIT License 2 | 3 | Copyright (c) 2010 suer 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | --------------------------------------------------------------------------------