~ubuntu-branches/ubuntu/saucy/tdiary/saucy-proposed

« back to all changes in this revision

Viewing changes to contrib2/plugin/jdate.rb

  • Committer: Bazaar Package Importer
  • Author(s): Daigo Moriwaki
  • Date: 2011-04-11 21:53:16 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110411215316-ih4gt4q8p29d2wf8
Tags: 3.0.1-1
* New upstream release (Closes: #542801, #594947)
* debian/control:
 - Bumped up Standards-Version to 3.9.1.
 - Updated version dependency.
* debian/tdiary-setup.rb: Followed the upstream changes, incorporating js and
  index.fcgi

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# jdate.rb $Revision: 1.1 $
 
2
#
 
3
#「%J」で日本語の曜日名を出す
 
4
#    pluginに入れるだけで動作する。
 
5
#    日付フォーマットなどで「%J」を指定するとそこが日本語の曜日になる
 
6
#
 
7
# Copyright (c) 2003 TADA Tadashi <sho@spc.gr.jp>
 
8
# You can distribute this file under the GPL.
 
9
#
 
10
unless Time::new.respond_to?( :strftime_jdate_backup ) then
 
11
        eval( <<-MODIFY_CLASS, TOPLEVEL_BINDING )
 
12
                class Time
 
13
                   alias strftime_jdate_backup strftime
 
14
                   JWDAY = %w(日 月 火 水 木 金 土)
 
15
                   def strftime( format )
 
16
                      strftime_jdate_backup( format.gsub( /%J/, JWDAY[self.wday] ) )
 
17
                   end
 
18
                end
 
19
        MODIFY_CLASS
 
20
end