יחידה:תאריך: הבדלים בין גרסאות בדף

מאין תקציר עריכה
מאין תקציר עריכה
שורה 552: שורה 552:
function Date:toHebrewString()
function Date:toHebrewString()
local hebrewStr = ''
local hebrewStr = ''
local year = self.year
if (self.precision >= Date.PRECISION.MY100) and (self.precision <= Date.PRECISION.MY) then
if (self.precision >= Date.PRECISION.MY100) and (self.precision <= Date.PRECISION.MY) then
שורה 568: שורה 569:
end
end
if self.precision == Date.PRECISION.YEAR100 then
if self.precision == Date.PRECISION.YEAR100 then
if self.year>0 then
local year =  math.floor((self.year+50)/100)*100 --round
         return 'המאה ה־'.. (self.year/100)
if year>0 then
         return 'המאה ה־'.. (year/100)
         else
         else
         return 'המאה ה־'.. (-self.year/100) ..' לפנה״ס'
         return 'המאה ה־'.. (-year/100) ..' לפנה״ס'
         end
         end
     end
     end