@@ -63,7 +63,7 @@ window.onload = function () {
6363 ui_day_positionX : 0 ,
6464 ui_day_positionY : 0 ,
6565 ui_date_date : "0" ,
66- ui_date_orientation : false ,
66+ ui_date_style : "0" ,
6767 ui_date_year : "2" ,
6868 ui_date_order : "0" ,
6969 ui_date_monthName : false ,
@@ -202,7 +202,7 @@ window.onload = function () {
202202 dateFolder . add ( options , "ui_date_monthName" ) . name ( "Month Name" ) . onChange ( updateMask ) ;
203203 dateFolder . add ( options , "ui_date_allCaps" ) . name ( "All CAPS" ) . onChange ( updateMask ) ;
204204 dateFolder . add ( options , "ui_date_delimiter" , optionsToDict ( config . general . properties . ui_date_delimiter . options ) ) . name ( "Delimiter" ) . onChange ( updateMask ) ;
205- dateFolder . add ( options , "ui_date_orientation" ) . name ( "Vertical Orientation " ) . onChange ( updateMask ) ;
205+ dateFolder . add ( options , "ui_date_style" , optionsToDict ( config . general . properties . ui_date_style . options ) ) . name ( "Style " ) . onChange ( updateMask ) ;
206206 dateFolder . add ( options , "ui_date_scale" ) . min ( 0 ) . max ( 10 ) . step ( 1 ) . name ( "Scale" ) . onChange ( updateMask ) ;
207207 const datePositionFolder = dateFolder . addFolder ( "Position" ) ;
208208 datePositionFolder . add ( options , "ui_date_positionX" ) . min ( - 100 ) . max ( 100 ) . step ( 1 ) . name ( "X" ) . onChange ( updateMask ) ;
@@ -346,8 +346,8 @@ window.onload = function () {
346346 options . ui_date_date = properties . ui_date_date . value ;
347347 updateTime ( ) ;
348348 }
349- if ( properties . ui_date_orientation )
350- options . ui_date_orientation = properties . ui_date_orientation . value ;
349+ if ( properties . ui_date_style )
350+ options . ui_date_style = properties . ui_date_style . value ;
351351 if ( properties . ui_date_year )
352352 options . ui_date_year = properties . ui_date_year . value ;
353353 if ( properties . ui_date_order )
@@ -364,7 +364,7 @@ window.onload = function () {
364364 options . ui_date_positionX = properties . ui_date_positionx . value ;
365365 if ( properties . ui_date_positiony )
366366 options . ui_date_positionY = properties . ui_date_positiony . value ;
367- if ( properties . ui_date_date || properties . ui_date_orientation || properties . ui_date_year ||
367+ if ( properties . ui_date_date || properties . ui_date_style || properties . ui_date_year ||
368368 properties . ui_date_order || properties . ui_date_monthname || properties . ui_date_allcaps ||
369369 properties . ui_date_delimiter || properties . ui_date_scale || properties . ui_date_positionx
370370 || properties . ui_date_positiony )
@@ -541,8 +541,8 @@ window.onload = function () {
541541 updateTime ( ) ;
542542 updateMask ( ) ;
543543 break ;
544- case "ui_date_orientation " :
545- options . ui_date_orientation = val . value ;
544+ case "ui_date_style " :
545+ options . ui_date_style = val . value ;
546546 updateMask ( ) ;
547547 break ;
548548 case "ui_date_year" :
@@ -806,33 +806,48 @@ window.onload = function () {
806806 }
807807
808808 if ( options . ui_date_date != "0" ) {
809- var dateText = date . toString ( ) , monthText , yearText = "" , completeDate ;
810- if ( dateText . length < 2 )
811- dateText = "0" + dateText ;
809+ var text3 = date . toString ( ) , text2 , text1 = "" , completeDate ;
810+ if ( text3 . length < 2 )
811+ text3 = "0" + text3 ;
812812 if ( options . ui_date_monthName ) {
813- monthText = months [ parseInt ( options . ui_date_date ) - 1 ] [ month - 1 ] ;
813+ text2 = months [ parseInt ( options . ui_date_date ) - 1 ] [ month - 1 ] ;
814814 if ( options . ui_date_allCaps )
815- monthText = monthText . toUpperCase ( ) ;
815+ text2 = text2 . toUpperCase ( ) ;
816816 } else {
817- monthText = month . toString ( ) ;
818- if ( monthText . length < 2 )
819- monthText = "0" + monthText ;
817+ text2 = month . toString ( ) ;
818+ if ( text2 . length < 2 )
819+ text2 = "0" + text2 ;
820820 }
821821 switch ( options . ui_date_year ) {
822822 case "1" : {
823- yearText = year . toString ( ) . substring ( 2 , 4 ) ;
823+ text1 = year . toString ( ) . substring ( 2 , 4 ) ;
824824 break ;
825825 }
826826 case "2" : {
827- yearText = year . toString ( ) ;
827+ text1 = year . toString ( ) ;
828828 break ;
829829 }
830830 }
831831
832- let delimiter = options . ui_date_orientation ? "" : dateDelimiters [ parseInt ( options . ui_date_delimiter ) ] ;
833- completeDate = yearText + ( yearText . length > 0 ? delimiter : "" ) + ( options . ui_date_order == "0" ? monthText + delimiter + dateText : dateText + delimiter + monthText ) ;
834- if ( options . ui_date_orientation )
835- completeDate = completeDate . split ( "" ) . join ( "\\n" ) ;
832+ if ( options . ui_date_order == 1 ) {
833+ let tmp = text2 ;
834+ text2 = text3 ;
835+ text3 = tmp ;
836+ }
837+
838+ let delimiter = dateDelimiters [ parseInt ( options . ui_date_delimiter ) ] ;
839+
840+ switch ( options . ui_date_style ) {
841+ case "0" :
842+ completeDate = ( text1 . length > 0 ? [ text1 , text2 , text3 ] : [ text2 , text3 ] ) . join ( delimiter ) ;
843+ break ;
844+ case "1" :
845+ completeDate = ( text1 . length > 0 ? [ text1 , text2 , text3 ] : [ text2 , text3 ] ) . join ( "\\n" ) ;
846+ break ;
847+ case "2" :
848+ completeDate = ( text1 + text2 + text3 ) . split ( "" ) . join ( "\\n" ) ;
849+ break ;
850+ }
836851
837852 if ( options . ui_date_scale > 0 ) {
838853 let bb = getTextBoundingBox ( completeDate , options . ui_date_scale ) ;
0 commit comments