59 lines
38 KiB
Go
Raw Normal View History

//
2020-08-23 14:15:53 +00:00
// Copyright 2020 FoxyUtils ehf. All rights reserved.
//
// This is a commercial product and requires a license to operate.
// A trial license can be obtained at https://unidoc.io
//
// DO NOT EDIT: generated by unitwist Go source code obfuscator.
//
// Use of this source code is governed by the UniDoc End User License Agreement
// terms that can be accessed at https://unidoc.io/eula/
2020-08-23 14:15:53 +00:00
// Package format provides support for parsing and evaluating
// spreadsheetml/Excel number formats.
//
// Internally spreadsheets store numbers and dates values as a text
// representation of a floating point number (e.g. 1.2345). This number is then
// displayed in Excel or another spreadsheet viewer differently depending on the
// number fornat of the cell style applied to the cell.
//
// As an example, the same value of 1.2345 can be displayed as:
// - "1" with format "0"
// - "1.2" with format "0.0"
// - "1.23" with format "0.00"
// - "1.235" with format "0.000"
// - "123%" with format "0%"
// - "1 23/100" with fornat "0 0/100"
// - "1.23E+00" with format "0.00E+00"
// - "29:37:41s" with format `[h]:mm:ss"s"`
2021-11-10 11:45:21 +00:00
package format ;import (_ad "bytes";_e "fmt";_aa "github.com/unidoc/unioffice/common/logger";_f "io";_gf "math";_g "strconv";_eb "strings";_c "time";);const _gde int =-1;const _ea ="\u0046\u006d\u0074\u0054\u0079\u0070\u0065\u004c\u0069\u0074\u0065\u0072a\u006c\u0046\u006d\u0074\u0054\u0079\u0070\u0065\u0044\u0069\u0067\u0069\u0074\u0046\u006d\u0074\u0054y\u0070\u0065\u0044i\u0067\u0069\u0074\u004f\u0070\u0074\u0046\u006d\u0074\u0054\u0079\u0070\u0065\u0043o\u006d\u006d\u0061\u0046\u006d\u0074\u0054\u0079\u0070\u0065\u0044\u0065\u0063\u0069\u006da\u006c\u0046\u006d\u0074\u0054\u0079\u0070\u0065Pe\u0072\u0063e\u006e\u0074\u0046\u006d\u0074\u0054\u0079\u0070e\u0044\u006f\u006c\u006c\u0061\u0072\u0046\u006d\u0074Ty\u0070\u0065\u0044i\u0067\u0069\u0074\u004f\u0070\u0074\u0054\u0068\u006f\u0075\u0073\u0061n\u0064\u0073\u0046\u006d\u0074\u0054\u0079\u0070\u0065\u0055n\u0064\u0065\u0072\u0073c\u006f\u0072\u0065\u0046\u006d\u0074T\u0079\u0070\u0065\u0044\u0061\u0074\u0065\u0046\u006d\u0074\u0054y\u0070e\u0054\u0069\u006d\u0065\u0046\u006d\u0074\u0054\u0079\u0070\u0065\u0046\u0072\u0061\u0063t\u0069\u006f\u006e\u0046\u006dt\u0054\u0079\u0070\u0065\u0054e\u0078\u0074";func _fgb (_gd []byte )[]byte {for _ae :=0;_ae < len (_gd )/2;_ae ++{_bb :=len (_gd )-1-_ae ;_gd [_ae ],_gd [_bb ]=_gd [_bb ],_gd [_ae ];};return _gd ;};const _aagc int =34;func _cf (_ccgc float64 )string {_ebb :=_g .FormatFloat (_ccgc ,'E',-1,64);_cag :=_g .FormatFloat (_ccgc ,'E',5,64);if len (_ebb )< len (_cag ){return _g .FormatFloat (_ccgc ,'E',2,64);};return _cag ;};
// Token is a format token in the Excel format string.
type Token struct{Type FmtType ;Literal byte ;DateTime string ;};const _d =1e11;func Parse (s string )[]Format {_bcbg :=Lexer {};_bcbg .Lex (_eb .NewReader (s ));_bcbg ._cad =append (_bcbg ._cad ,_bcbg ._eeb );return _bcbg ._cad ;};func _bge (_eaad int64 ,_gdc Format )[]byte {if !_gdc .IsExponential ||len (_gdc .Exponent )==0{return nil ;};_ac :=_g .AppendInt (nil ,_ecb (_eaad ),10);_fdg :=make ([]byte ,0,len (_ac )+2);_fdg =append (_fdg ,'E');if _eaad >=0{_fdg =append (_fdg ,'+');}else {_fdg =append (_fdg ,'-');_eaad *=-1;};_bfa :=0;_fbf :for _db :=len (_gdc .Exponent )-1;_db >=0;_db --{_cee :=len (_ac )-1-_bfa ;_aae :=_gdc .Exponent [_db ];switch _aae .Type {case FmtTypeDigit :if _cee >=0{_fdg =append (_fdg ,_ac [_cee ]);_bfa ++;}else {_fdg =append (_fdg ,'0');};case FmtTypeDigitOpt :if _cee >=0{_fdg =append (_fdg ,_ac [_cee ]);_bfa ++;}else {for _cgd :=_db ;_cgd >=0;_cgd --{_aeg :=_gdc .Exponent [_cgd ];if _aeg .Type ==FmtTypeLiteral {_fdg =append (_fdg ,_aeg .Literal );};};break _fbf ;};case FmtTypeLiteral :_fdg =append (_fdg ,_aae .Literal );default:_aa .Log .Debug ("\u0075\u006e\u0073\u0075\u0070\u0070\u006f\u0072\u0074\u0065\u0064 \u0074\u0079\u0070\u0065\u0020\u0069\u006e\u0020\u0065\u0078p\u0020\u0025\u0076",_aae );};};if _bfa < len (_ac ){_fdg =append (_fdg ,_ac [len (_ac )-_bfa -1:_bfa -1]...);};_fgb (_fdg [2:]);return _fdg ;};const (FmtTypeLiteral FmtType =iota ;FmtTypeDigit ;FmtTypeDigitOpt ;FmtTypeComma ;FmtTypeDecimal ;FmtTypePercent ;FmtTypeDollar ;FmtTypeDigitOptThousands ;FmtTypeUnderscore ;FmtTypeDate ;FmtTypeTime ;FmtTypeFraction ;FmtTypeText ;);type Lexer struct{_eeb Format ;_cad []Format ;};const _bdb int =0;
// Format is a parsed number format.
type Format struct{Whole []Token ;Fractional []Token ;Exponent []Token ;IsExponential bool ;_fga bool ;_bg bool ;_cg bool ;_adc bool ;_cc bool ;_gb bool ;_af int64 ;_ba int ;};
2021-04-23 20:00:00 +00:00
2021-09-22 16:41:01 +00:00
// Number is used to format a number with a format string. If the format
// string is empty, then General number formatting is used which attempts to mimic
// Excel's general formatting.
2021-11-10 11:45:21 +00:00
func Number (v float64 ,f string )string {if f ==""||f =="\u0047e\u006e\u0065\u0072\u0061\u006c"||f =="\u0040"{return NumberGeneric (v );};_gfd :=Parse (f );if len (_gfd )==1{return _ee (v ,_gfd [0],false );}else if len (_gfd )> 1&&v < 0{return _ee (v ,_gfd [1],true );}else if len (_gfd )> 2&&v ==0{return _ee (v ,_gfd [2],false );};return _ee (v ,_gfd [0],false );};const _def int =0;func _ge (_bbg ,_fdf float64 ,_fdd Format )[]byte {if len (_fdd .Fractional )==0{return nil ;};_ddc :=_g .AppendFloat (nil ,_bbg ,'f',-1,64);if len (_ddc )> 2{_ddc =_ddc [2:];}else {_ddc =nil ;};_fdb :=make ([]byte ,0,len (_ddc ));_fdb =append (_fdb ,'.');_feg :=0;_dea :for _fb :=0;_fb < len (_fdd .Fractional );_fb ++{_ega :=_fb ;_aag :=_fdd .Fractional [_fb ];switch _aag .Type {case FmtTypeDigit :if _ega < len (_ddc ){_fdb =append (_fdb ,_ddc [_ega ]);_feg ++;}else {_fdb =append (_fdb ,'0');};case FmtTypeDigitOpt :if _ega >=0{_fdb =append (_fdb ,_ddc [_ega ]);_feg ++;}else {break _dea ;};case FmtTypeLiteral :_fdb =append (_fdb ,_aag .Literal );default:_aa .Log .Debug ("\u0075\u006e\u0073\u0075\u0070\u0070o\u0072\u0074\u0065\u0064\u0020\u0074\u0079\u0070\u0065\u0020\u0069\u006e\u0020f\u0072\u0061\u0063\u0074\u0069\u006f\u006ea\u006c\u0020\u0025\u0076",_aag );};};return _fdb ;};const _bdff int =34;func _dbc (_cce _c .Time ,_ffa float64 ,_ddb string )[]byte {_gc :=[]byte {};_bff :=0;for _ceea :=0;_ceea < len (_ddb );_ceea ++{var _ggc string ;if _ddb [_ceea ]==':'{_ggc =string (_ddb [_bff :_ceea ]);_bff =_ceea +1;}else if _ceea ==len (_ddb )-1{_ggc =string (_ddb [_bff :_ceea +1]);}else {continue ;};switch _ggc {case "\u0064":_gc =_cce .AppendFormat (_gc ,"\u0032");case "\u0068":_gc =_cce .AppendFormat (_gc ,"\u0033");case "\u0068\u0068":_gc =_cce .AppendFormat (_gc ,"\u0031\u0035");case "\u006d":_gc =_cce .AppendFormat (_gc ,"\u0034");case "\u006d\u006d":_gc =_cce .AppendFormat (_gc ,"\u0030\u0034");case "\u0073":_gc =_cce .Round (_c .Second ).AppendFormat (_gc ,"\u0035");case "\u0073\u002e\u0030":_gc =_cce .Round (_c .Second /10).AppendFormat (_gc ,"\u0035\u002e\u0030");case "\u0073\u002e\u0030\u0030":_gc =_cce .Round (_c .Second /100).AppendFormat (_gc ,"\u0035\u002e\u0030\u0030");case "\u0073\u002e\u00300\u0030":_gc =_cce .Round (_c .Second /1000).AppendFormat (_gc ,"\u0035\u002e\u00300\u0030");case "\u0073\u0073":_gc =_cce .Round (_c .Second ).AppendFormat (_gc ,"\u0030\u0035");case "\u0073\u0073\u002e\u0030":_gc =_cce .Round (_c .Second /10).AppendFormat (_gc ,"\u0030\u0035\u002e\u0030");case "\u0073\u0073\u002e0\u0030":_gc =_cce .Round (_c .Second /100).AppendFormat (_gc ,"\u0030\u0035\u002e0\u0030");case "\u0073\u0073\u002e\u0030\u0030\u0030":_gc =_cce .Round (_c .Second /1000).AppendFormat (_gc ,"\u0030\u0035\u002e\u0030\u0030\u0030");case "\u0041\u004d\u002fP\u004d":_gc =_cce .AppendFormat (_gc ,"\u0050\u004d");case "\u005b\u0068\u005d":_gc =_g .AppendInt (_gc ,int64 (_ffa *24),10);case "\u005b\u006d\u005d":_gc =_g .AppendInt (_gc ,int64 (_ffa *24*60),10);case "\u005b\u0073\u005d":_gc =_g .AppendInt (_gc ,int64 (_ffa *24*60*60),10);case "":default:_aa .Log .Debug ("\u0075\u006e\u0073\u0075\u0070\u0070\u006f\u0072\u0074\u0065\u0064 \u0074\u0069\u006d\u0065\u0020\u0066\u006f\u0072\u006d\u0061t\u0020\u0025\u0073",_ggc );};if _ddb [_ceea ]==':'{_gc =append (_gc ,':');};};return _gc ;};func (_ecbg *Lexer )nextFmt (){_ecbg ._cad =append (_ecbg ._cad ,_ecbg ._eeb );_ecbg ._eeb =Format {}};const _febe int =-1;var _fg =[...]uint8 {0,14,26,41,53,67,81,94,118,135,146,157,172,183};func _ecb (_eaa int64 )int64 {if _eaa < 0{return -_eaa ;};return _eaa ;};func _befed (_adba _c .Time )_c .Time {_adba =_adba .UTC ();return _c .Date (_adba .Year (),_adba .Month (),_adba .Day (),_adba .Hour (),_adba .Minute (),_adba .Second (),_adba .Nanosecond (),_c .Local );};func _ee (_ef float64 ,_ab Format ,_fae bool )string {if _ab ._cg {return NumberGeneric (_ef );};_afd :=make ([]byte ,0,20);_da :=_gf .Signbit (_ef );_eg :=_gf .Abs (_ef );_aec :=int64 (0);_cga :=int64 (0);if _ab .IsExponential {for _eg >=10{_cga ++;_eg /=10;};for _eg < 1{_cga --;_eg *=10;};}else
2021-06-16 07:10:52 +00:00
2021-09-22 16:41:01 +00:00
// Value formats a value as a number or string depending on if it appears to be
// a number or string.
2021-11-10 11:45:21 +00:00
func Value (v string ,f string )string {if IsNumber (v ){_cgc ,_ :=_g .ParseFloat (v ,64);return Number (_cgc ,f );};return String (v ,f );};const _b =1e-10;func (_ag FmtType )String ()string {if _ag >=FmtType (len (_fg )-1){return _e .Sprintf ("F\u006d\u0074\u0054\u0079\u0070\u0065\u0028\u0025\u0064\u0029",_ag );};return _ea [_fg [_ag ]:_fg [_ag +1]];};func (_ebca *Lexer )Lex (r _f .Reader ){_dfdd ,_egd ,_edaf :=0,0,0;_eabd :=-1;_abg ,_bgb ,_debb :=0,0,0;_ =_bgb ;_ =_debb ;_fce :=1;_ =_fce ;_fff :=make ([]byte ,4096);_bfff :=false ;for !_bfff {_acc :=0;if _abg > 0{_acc =_egd -_abg ;};_egd =0;_cegf ,_ccef :=r .Read (_fff [_acc :]);if _cegf ==0||_ccef !=nil {_bfff =true ;};_edaf =_cegf +_acc ;if _edaf < len (_fff ){_eabd =_edaf ;};{_dfdd =_aagc ;_abg =0;_bgb =0;_debb =0;};{if _egd ==_edaf {goto _fcc ;};switch _dfdd {case 34:goto _cgde ;case 35:goto _faa ;case 0:goto _abbbf ;case 36:goto _cbc ;case 37:goto _cdfe ;case 1:goto _cgcfc ;case 2:goto _bgaa ;case 38:goto _egdb ;case 3:goto _eag ;case 4:goto _fcg ;case 39:goto _egf ;case 5:goto _bde ;case 6:goto _fgbd ;case 7:goto _dgf ;case 8:goto _abce ;case 40:goto _ecc ;case 9:goto _eage ;case 41:goto _aac ;case 10:goto _abcb ;case 42:goto _ceb ;case 11:goto _dee ;case 43:goto _fbe ;case 44:goto _bbe ;case 45:goto _cbcc ;case 12:goto _abfe ;case 46:goto _bea ;case 13:goto _daaf ;case 14:goto _afge ;case 15:goto _geg ;case 16:goto _bcbd ;case 47:goto _bfg ;case 17:goto _cbcb ;case 48:goto _fcd ;case 18:goto _beg ;case 19:goto _fdfa ;case 20:goto _egce ;case 49:goto _beed ;case 50:goto _ccca ;case 21:goto _ceff ;case 22:goto _bfcg ;case 23:goto _cfd ;case 24:goto _aabg ;case 25:goto _aaad ;case 51:goto _daf ;case 26:goto _gceb ;case 52:goto _aef ;case 53:goto _bab ;case 54:goto _acd ;case 55:goto _gcgg ;case 56:goto _gda ;case 57:goto _aaca ;case 27:goto _fbag ;case 28:goto _fdga ;case 29:goto _eedc ;case 30:goto _aaac ;case 31:goto _dagc ;case 58:goto _debf ;case 32:goto _gba ;case 59:goto _gef ;case 33:goto _bebf ;case 60:goto _dcfd ;case 61:goto _ddf ;case 62:goto _eebe ;};goto _gfda ;_baa :switch _debb {case 2:{_egd =(_bgb )-1;_ebca ._eeb .AddToken (FmtTypeDigit ,nil );};case 3:{_egd =(_bgb )-1;_ebca ._eeb .AddToken (FmtTypeDigitOpt ,nil );};case 5:{_egd =(_bgb )-1;};case 8:{_egd =(_bgb )-1;_ebca ._eeb .AddToken (FmtTypePercent ,nil );};case 13:{_egd =(_bgb )-1;_ebca ._eeb .AddToken (FmtTypeFraction ,_fff [_abg :_bgb ]);};case 14:{_egd =(_bgb )-1;_ebca ._eeb .AddToken (FmtTypeDate ,_fff [_abg :_bgb ]);};case 15:{_egd =(_bgb )-1;_ebca ._eeb .AddToken (FmtTypeTime ,_fff [_abg :_bgb ]);};case 16:{_egd =(_bgb )-1;_ebca ._eeb .AddToken (FmtTypeTime ,_fff [_abg :_bgb ]);};case 18:{_egd =(_bgb )-1;};case 20:{_egd =(_bgb )-1;_ebca ._eeb .AddToken (FmtTypeLiteral ,_fff [_abg :_bgb ]);};case 21:{_egd =(_bgb )-1;_ebca ._eeb .AddToken (FmtTypeLiteral ,_fff [_abg +1:_bgb -1]);};};goto _bbd ;_dgb :_egd =(_bgb )-1;{_ebca ._eeb .AddToken (FmtTypeFraction ,_fff [_abg :_bgb ]);};goto _bbd ;_fbg :_egd =(_bgb )-1;{_ebca ._eeb .AddToken (FmtTypeDigitOpt ,nil );};goto _bbd ;_daa :_bgb =_egd +1;{_ebca ._eeb .AddToken (FmtTypeDigitOptThousands ,nil );};goto _bbd ;_aba :_egd =(_bgb )-1;{_ebca ._eeb .AddToken (FmtTypePercent ,nil );};goto _bbd ;_cef :_egd =(_bgb )-1;{_ebca ._eeb .AddToken (FmtTypeDate ,_fff [_abg :_bgb ]);};goto _bbd ;_bgg :_egd =(_bgb )-1;{_ebca ._eeb .AddToken (FmtTypeDigit ,nil );};goto _bbd ;_cdee :_egd =(_bgb )-1;{_ebca ._eeb .AddToken (FmtTypeTime ,_fff [_abg :_bgb ]);};goto _bbd ;_addb :_egd =(_bgb )-1;{_ebca ._eeb .AddToken (FmtTypeLiteral ,_fff [_abg :_bgb ]);};goto _bbd ;_ggcb :_bgb =_egd +1;{_ebca ._eeb ._cg =true ;};goto _bbd ;_cgcf :_bgb =_egd +1;{_ebca ._eeb .AddToken (FmtTypeLiteral ,_fff [_abg :_bgb ]);};goto _bbd ;_dba :_bgb =_egd +1;{_ebca ._eeb .AddToken (FmtTypeDollar ,nil );};goto _bbd ;_cega :_bgb =_egd +1;{_ebca ._eeb .AddToken (FmtTypeComma ,nil );};goto _bbd ;_eed :_bgb =_egd +1;{_ebca ._eeb .AddToken (FmtTypeDecimal ,nil );};goto _bbd ;_deaa :_bgb =_egd +1;{_ebca .nextFmt ();};goto _bbd ;_gdga :_bgb =_egd +1;{_ebca ._eeb .AddToken (FmtTypeText ,nil );};goto
2020-12-17 22:07:08 +00:00
2021-11-10 11:45:21 +00:00
// AddToken adds a format token to the format.
func (_gg *Format )AddToken (t FmtType ,l []byte ){if _gg ._cc {_gg ._cc =false ;return ;};switch t {case FmtTypeDecimal :_gg ._gb =true ;case FmtTypeUnderscore :_gg ._cc =true ;case FmtTypeText :_gg .Whole =append (_gg .Whole ,Token {Type :t });case FmtTypeDate ,FmtTypeTime :_gg .Whole =append (_gg .Whole ,Token {Type :t ,DateTime :string (l )});case FmtTypePercent :_gg ._bg =true ;t =FmtTypeLiteral ;l =[]byte {'%'};fallthrough;case FmtTypeDigitOpt :fallthrough;case FmtTypeLiteral ,FmtTypeDigit ,FmtTypeDollar ,FmtTypeComma :if l ==nil {l =[]byte {0};};for _ ,_fd :=range l {if _gg .IsExponential {_gg .Exponent =append (_gg .Exponent ,Token {Type :t ,Literal :_fd });}else if !_gg ._gb {_gg .Whole =append (_gg .Whole ,Token {Type :t ,Literal :_fd });}else {_gg .Fractional =append (_gg .Fractional ,Token {Type :t ,Literal :_fd });};};case FmtTypeDigitOptThousands :_gg ._adc =true ;case FmtTypeFraction :_de :=_eb .Split (string (l ),"\u002f");if len (_de )==2{_gg ._fga =true ;_gg ._af ,_ =_g .ParseInt (_de [1],10,64);for _ ,_fa :=range _de [1]{if _fa =='?'||_fa =='0'{_gg ._ba ++;};};};default:_aa .Log .Debug ("\u0075\u006e\u0073u\u0070\u0070\u006f\u0072t\u0065\u0064\u0020\u0070\u0068\u0020\u0074y\u0070\u0065\u0020\u0069\u006e\u0020\u0070\u0061\u0072\u0073\u0065\u0020\u0025\u0076",t );};};func _fba (_egc []byte )[]byte {for _dcg :=len (_egc )-1;_dcg > 0;_dcg --{if _egc [_dcg ]=='9'+1{_egc [_dcg ]='0';if _egc [_dcg -1]=='.'{_dcg --;};_egc [_dcg -1]++;};};if _egc [0]=='9'+1{_egc [0]='0';copy (_egc [1:],_egc [0:]);_egc [0]='1';};return _egc ;};
2021-03-16 20:51:18 +00:00
2021-08-23 20:44:48 +00:00
// String returns the string formatted according to the type. In format strings
// this is the fourth item, where '@' is used as a placeholder for text.
2021-11-10 11:45:21 +00:00
func String (v string ,f string )string {_cd :=Parse (f );var _ce Format ;if len (_cd )==1{_ce =_cd [0];}else if len (_cd )==4{_ce =_cd [3];};_ff :=false ;for _ ,_gbd :=range _ce .Whole {if _gbd .Type ==FmtTypeText {_ff =true ;};};if !_ff {return v ;};_edee :=_ad .Buffer {};for _ ,_bga :=range _ce .Whole {switch _bga .Type {case FmtTypeLiteral :_edee .WriteByte (_bga .Literal );case FmtTypeText :_edee .WriteString (v );};};return _edee .String ();};func _gbg (_abb []byte )[]byte {_aaa :=len (_abb );_gae :=false ;_abbb :=false ;for _faeg :=len (_abb )-1;_faeg >=0;_faeg --{if _abb [_faeg ]=='0'&&!_abbb &&!_gae {_aaa =_faeg ;}else if _abb [_faeg ]=='.'{_gae =true ;}else {_abbb =true ;};};if _gae &&_abbb {if _abb [_aaa -1]=='.'{_aaa --;};return _abb [0:_aaa ];};return _abb ;};
2021-07-30 17:03:26 +00:00
2021-11-10 11:45:21 +00:00
// FmtType is the type of a format token.
//go:generate stringer -type=FmtType
type FmtType byte ;
2021-09-22 16:41:01 +00:00
2021-11-10 11:45:21 +00:00
// NumberGeneric formats the number with the generic format which attemps to
// mimic Excel's general formatting.
func NumberGeneric (v float64 )string {if _gf .Abs (v )>=_d ||_gf .Abs (v )<=_b &&v !=0{return _cf (v );};_dda :=make ([]byte ,0,15);_dda =_g .AppendFloat (_dda ,v ,'f',-1,64);if len (_dda )> 11{_cb :=_dda [11]-'0';if _cb >=5&&_cb <=9{_dda [10]++;_dda =_dda [0:11];_dda =_fba (_dda );};_dda =_dda [0:11];}else if len (_dda )==11{if _dda [len (_dda )-1]=='9'{_dda [len (_dda )-1]++;_dda =_fba (_dda );};};_dda =_gbg (_dda );return string (_dda );};func _afg (_cgcd _c .Time ,_bdf string )[]byte {_aeb :=[]byte {};_deg :=0;for _cea :=0;_cea < len (_bdf );_cea ++{var _cgcdd string ;if _bdf [_cea ]=='/'{_cgcdd =string (_bdf [_deg :_cea ]);_deg =_cea +1;}else if _cea ==len (_bdf )-1{_cgcdd =string (_bdf [_deg :_cea +1]);}else {continue ;};switch _cgcdd {case "\u0079\u0079":_aeb =_cgcd .AppendFormat (_aeb ,"\u0030\u0036");case "\u0079\u0079\u0079\u0079":_aeb =_cgcd .AppendFormat (_aeb ,"\u0032\u0030\u0030\u0036");case "\u006d":_aeb =_cgcd .AppendFormat (_aeb ,"\u0031");case "\u006d\u006d":_aeb =_cgcd .AppendFormat (_aeb ,"\u0030\u0031");case "\u006d\u006d\u006d":_aeb =_cgcd .AppendFormat (_aeb ,"\u004a\u0061\u006e");case "\u006d\u006d\u006d\u006d":_aeb =_cgcd .AppendFormat (_aeb ,"\u004aa\u006e\u0075\u0061\u0072\u0079");case "\u006d\u006d\u006dm\u006d":switch _cgcd .Month (){case _c .January ,_c .July ,_c .June :_aeb =append (_aeb ,'J');case _c .February :_aeb =append (_aeb ,'M');case _c .March ,_c .May :_aeb =append (_aeb ,'M');case _c .April ,_c .August :_aeb =append (_aeb ,'A');case _c .September :_aeb =append (_aeb ,'S');case _c .October :_aeb =append (_aeb ,'O');case _c .November :_aeb =append (_aeb ,'N');case _c .December :_aeb =append (_aeb ,'D');};case "\u0064":_aeb =_cgcd .AppendFormat (_aeb ,"\u0032");case "\u0064\u0064":_aeb =_cgcd .AppendFormat (_aeb ,"\u0030\u0032");case "\u0064\u0064\u0064":_aeb =_cgcd .AppendFormat (_aeb ,"\u004d\u006f\u006e");case "\u0064\u0064\u0064\u0064":_aeb =_cgcd .AppendFormat (_aeb ,"\u004d\u006f\u006e\u0064\u0061\u0079");default:_aa .Log .Debug ("\u0075\u006e\u0073\u0075\u0070\u0070\u006f\u0072\u0074\u0065\u0064 \u0064\u0061\u0074\u0065\u0020\u0066\u006f\u0072\u006d\u0061t\u0020\u0025\u0073",_cgcdd );};if _bdf [_cea ]=='/'{_aeb =append (_aeb ,'/');};};return _aeb ;};