• Eike Rathke's avatar
    Resolves: tdf#100452 class Date full (BCE,CE) proleptic Gregorian calendar · 6d4f2dcc
    Eike Rathke yazdı
    ... implementing signed years with year 0 gap.
    Date(31,12,-1) last day BCE
    Date(1,1,1) first day CE
    
    New class Date member functions:
    * AddYears(sal_Int16) to be used instead of
      aDate.SetYear(aDate.GetYear()+sal_Int16) to handle year 0 gap.
    * convenience GetNextYear() to be used insted of GetYear()+1
    * convenience GetPrevYear() to be used insted of GetYear()-1
    * AddMonths(sal_Int32)
    * operator=(const css::util::Date&)
    
    New class DateTime member functions:
    * operator=(const css::util::DateTime&)
    
    Made some conversion ctors explicit, specifically Date(sal_Int32)
    
    Adapted hopefully all places that used a sal_uInt16 year to use
    sal_Int16 where appropriate.
    
    Eliminated some quirks in date handling found on the fly.
    
    Added era handling to i18npool icu calendar setting interface, which
    missing was responsible for 0001-01-01 entered in Calc being set as
    -0001-01-01, hence subtracting one day resulted in -0002-12-31.
    
    Change-Id: I77b39fba9599ebd5067d7864f6c9ebe01f6f578f
    Reviewed-on: https://gerrit.libreoffice.org/27049Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
    Tested-by: 's avatarJenkins <ci@libreoffice.org>
    6d4f2dcc
test_date.cxx 2.48 KB