Ignore:
Timestamp:
Jan 19, 2010, 8:54:57 PM (14 years ago)
Author:
KOBAYASHI, Shinji
Message:

refs #71

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ruby/trunk/lib/open_ehr/assumed_library_types.rb

    r369 r397  
    135135
    136136    module ISO8601DateModule
     137      include Comparable
    137138      attr_reader :year, :month, :day
    138139
     
    180181        month_unknown? or day_unknown?
    181182      end
    182 
     183     
     184      def <=>(other)
     185        (@year*TimeDefinitions::NOMINAL_DAYS_IN_YEAR +
     186         @month*TimeDefinitions::NOMINAL_DAYS_IN_MONTH + @day) <=>
     187          (other.year*TimeDefinitions::NOMINAL_DAYS_IN_YEAR +
     188           other.month*TimeDefinitions::NOMINAL_DAYS_IN_MONTH + other.month)
     189      end
    183190      protected
    184191      def leapyear?(year)
Note: See TracChangeset for help on using the changeset viewer.