PageRenderTime 11ms CodeModel.GetById 1ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/src/lib/time/formatter/time_in_italian.e

http://github.com/tybor/Liberty
Specman e | 163 lines | 131 code | 6 blank | 26 comment | 3 complexity | a17cab5d518481dc4096f22930f0a5a3 MD5 | raw file
  1-- This file is part of a Liberty Eiffel library.
  2-- See the full copyright at the end.
  3--
  4class TIME_IN_ITALIAN
  5   --
  6   -- The Italian format class for class TIME.
  7   --
  8
  9inherit
 10   TIME_FORMATTER
 11
 12create {ANY}
 13   default_create, set_time
 14
 15feature {ANY}
 16   day_in (buffer: STRING)
 17      local
 18         s: STRING
 19      do
 20         if short_mode then
 21            inspect
 22               time.week_day
 23            when 0 then
 24               s := once "Dom"
 25            when 1 then
 26               s := once "Lun"
 27            when 2 then
 28               s := once "Mar"
 29            when 3 then
 30               s := once "Mer"
 31            when 4 then
 32               s := once "Gio"
 33            when 5 then
 34               s := once "Ven"
 35            when 6 then
 36               s := once "Sab"
 37            end
 38         else
 39            inspect
 40               time.week_day
 41            when 0 then
 42               s := once "Domenica"
 43            when 1 then
 44               s := once "Lunedi"
 45            when 2 then
 46               s := once "Martedi"
 47            when 3 then
 48               s := once "Mercoledi"
 49            when 4 then
 50               s := once "Giovedi"
 51            when 5 then
 52               s := once "Venerdi"
 53            when 6 then
 54               s := once "Sabato"
 55            end
 56         end
 57         buffer.append(s)
 58      end
 59
 60   month_in (buffer: STRING)
 61      local
 62         s: STRING
 63      do
 64         if short_mode then
 65            inspect
 66               time.month
 67            when 1 then
 68               s := once "Gen"
 69            when 2 then
 70               s := once "Feb"
 71            when 3 then
 72               s := once "Mar"
 73            when 4 then
 74               s := once "Apr"
 75            when 5 then
 76               s := once "Mag"
 77            when 6 then
 78               s := once "Giu"
 79            when 7 then
 80               s := once "Lug"
 81            when 8 then
 82               s := once "Ago"
 83            when 9 then
 84               s := once "Set"
 85            when 10 then
 86               s := once "Ott"
 87            when 11 then
 88               s := once "Nov"
 89            when 12 then
 90               s := once "Dic"
 91            end
 92         else
 93            inspect
 94               time.month
 95            when 1 then
 96               s := once "Gennaio"
 97            when 2 then
 98               s := once "Febbraio"
 99            when 3 then
100               s := once "Marzo"
101            when 4 then
102               s := once "Aprile"
103            when 5 then
104               s := once "Maggio"
105            when 6 then
106               s := once "Giugno"
107            when 7 then
108               s := once "Luglio"
109            when 8 then
110               s := once "Agosto"
111            when 9 then
112               s := once "Settembre"
113            when 10 then
114               s := once "Ottobre"
115            when 11 then
116               s := once "Novembre"
117            when 12 then
118               s := once "Dicembre"
119            end
120         end
121         buffer.append(s)
122      end
123
124   append_in (buffer: STRING)
125      do
126         day_in(buffer)
127         buffer.extend(' ')
128         time.day.append_in(buffer)
129         buffer.extend(' ')
130         month_in(buffer)
131         buffer.extend(' ')
132         time.year.append_in(buffer)
133         buffer.extend(' ')
134         time.hour.append_in(buffer)
135         buffer.extend(':')
136         time.minute.append_in(buffer)
137         if not short_mode then
138            buffer.extend(':')
139            time.second.append_in(buffer)
140         end
141      end
142
143end -- class TIME_IN_ITALIAN
144--
145-- Copyright (C) 2009-2017: by all the people cited in the AUTHORS file.
146--
147-- Permission is hereby granted, free of charge, to any person obtaining a copy
148-- of this software and associated documentation files (the "Software"), to deal
149-- in the Software without restriction, including without limitation the rights
150-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
151-- copies of the Software, and to permit persons to whom the Software is
152-- furnished to do so, subject to the following conditions:
153--
154-- The above copyright notice and this permission notice shall be included in
155-- all copies or substantial portions of the Software.
156--
157-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
158-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
159-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
160-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
161-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
162-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
163-- THE SOFTWARE.