public
Fork of Caged/gitnub
Description: A Gitk-like application written in RubyCocoa that looks like it belongs on a Mac. See the wiki for downloads and screenshots.
Homepage: http://alternateidea.com
Clone URL: git://github.com/kballard/gitnub.git
Search Repo:
Caged (author)
Thu May 01 11:26:45 -0700 2008
commit  d380c947f09b85a3e3e5cb08cb5121341f2f2f74
tree    81720769fe24f0bb30a865a16d1f5fc99df06dac
parent  8230ca3ae817a025a64a2aa2af1bf13cda4391a1
gitnub / lib / time_extensions.rb
100644 14 lines (14 sloc) 0.445 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class Time
  def to_system_time(style = :full)
    formatter = OSX::NSDateFormatter.alloc.init
    case style
      when :full
        formatter.dateStyle = OSX::NSDateFormatterMediumStyle
        formatter.timeStyle = OSX::NSDateFormatterShortStyle
      when :time
        formatter.dateStyle = OSX::NSDateFormatterNoStyle
        formatter.timeStyle = OSX::NSDateFormatterShortStyle
    end
    formatter.stringFromDate(self.to_ns)
  end
end