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