void formatQuarter ( StringBuilder b , ZonedDateTime d , int width , FieldVariants quarters ) { int quarter = ( d . getMonth ( ) . getValue ( ) - 1 ) / 3 ; switch ( width ) { case 5 : b . append ( quarters . narrow [ quarter ] ) ; break ; case 4 : b . append ( quarters . wide [ quarter ] ) ; break ; case 3 : b . append ( quarters . abbreviated [ quarter ] ) ; break ; case 2 : b . append ( ' ' ) ; // fall through case 1 : b . append ( quarter + 1 ) ; break ; } }
Format the quarter based on the month .