PageRenderTime 22ms CodeModel.GetById 12ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/src/lib/time/formatter/time_in_french.e

http://github.com/tybor/Liberty
Specman e | 168 lines | 136 code | 6 blank | 26 comment | 4 complexity | 536b3125d6c4be5f7ade6c16dbbc88ea 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_FRENCH
  5   --
  6   -- The French 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 "Dim"
 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 "Jeu"
 33            when 5 then
 34               s := once "Ven"
 35            when 6 then
 36               s := once "Sam"
 37            end
 38         else
 39            inspect
 40               time.week_day
 41            when 0 then
 42               s := once "Dimanche"
 43            when 1 then
 44               s := once "Lundi"
 45            when 2 then
 46               s := once "Mardi"
 47            when 3 then
 48               s := once "Mercredi"
 49            when 4 then
 50               s := once "Jeudi"
 51            when 5 then
 52               s := once "Vendredi"
 53            when 6 then
 54               s := once "Samedi"
 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 "Jan"
 69            when 2 then
 70               s := once "Fev"
 71            when 3 then
 72               s := once "Mar"
 73            when 4 then
 74               s := once "Avr"
 75            when 5 then
 76               s := once "Mai"
 77            when 6 then
 78               s := once "Juin"
 79            when 7 then
 80               s := once "Juil"
 81            when 8 then
 82               s := once "Aout"
 83            when 9 then
 84               s := once "Sept"
 85            when 10 then
 86               s := once "Oct"
 87            when 11 then
 88               s := once "Nov"
 89            when 12 then
 90               s := once "Dec"
 91            end
 92         else
 93            inspect
 94               time.month
 95            when 1 then
 96               s := once "Janvier"
 97            when 2 then
 98               s := once "Fevrier"
 99            when 3 then
100               s := once "Mars"
101            when 4 then
102               s := once "Avril"
103            when 5 then
104               s := once "Mai"
105            when 6 then
106               s := once "Juin"
107            when 7 then
108               s := once "Juillet"
109            when 8 then
110               s := once "Aout"
111            when 9 then
112               s := once "Septembre"
113            when 10 then
114               s := once "Octobre"
115            when 11 then
116               s := once "Novembre"
117            when 12 then
118               s := once "Decembre"
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         if short_mode then
133            (time.year #\\ 100).append_in(buffer)
134         else
135            time.year.append_in(buffer)
136         end
137         buffer.extend(' ')
138         time.hour.append_in(buffer)
139         buffer.extend('h')
140         time.minute.append_in(buffer)
141         buffer.extend('m')
142         if not short_mode then
143            time.second.append_in(buffer)
144            buffer.extend('s')
145         end
146      end
147
148end -- class TIME_IN_FRENCH
149--
150-- Copyright (C) 2009-2017: by all the people cited in the AUTHORS file.
151--
152-- Permission is hereby granted, free of charge, to any person obtaining a copy
153-- of this software and associated documentation files (the "Software"), to deal
154-- in the Software without restriction, including without limitation the rights
155-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
156-- copies of the Software, and to permit persons to whom the Software is
157-- furnished to do so, subject to the following conditions:
158--
159-- The above copyright notice and this permission notice shall be included in
160-- all copies or substantial portions of the Software.
161--
162-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
163-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
164-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
165-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
166-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
167-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
168-- THE SOFTWARE.