~ubuntu-branches/ubuntu/oneiric/ctioga2/oneiric

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# dates.rb: a Type to deal with dates
# Copyright (C) 2006, 2009 Vincent Fourmond
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA

require 'time'
require 'ctioga2/utils'

module CTioga2
  Version::register_svn_info('$Revision: 2 $', '$Date: 2009-04-25 14:03:30 +0200 (Sat, 25 Apr 2009) $')

  module MetaBuilder

    # The module Types should be used for all subclasses of Type, to
    # keep the place clean and tidy.
    module Types

      # A combination date/time
      class DateTimeParameter < Type

        type_name :date_time, 'date', Time.new

        def string_to_type_internal(str)
          return Time.parse(str)
        end

      end
    end

  end
end