@@ -4584,28 +4584,18 @@ function setShiftVal(ax, axShifts) {
45844584 * @returns {boolean }
45854585 */
45864586function periodCompatibleWithTickformat ( period , tickformat ) {
4587- if ( / % f / . test ( tickformat ) ) {
4588- if ( period < ONEMICROSEC ) return false ;
4589- } else if ( / % L / . test ( tickformat ) ) {
4590- if ( period < 1 ) return false ;
4591- } else if ( / % [ S X ] / . test ( tickformat ) ) {
4592- if ( period < ONESEC ) return false ;
4593- } else if ( / % M / . test ( tickformat ) ) {
4594- if ( period < ONEMIN ) return false ;
4595- } else if ( / % [ H I ] / . test ( tickformat ) ) {
4596- if ( period < ONEHOUR ) return false ;
4597- } else if ( / % p / . test ( tickformat ) ) {
4598- if ( period < HALFDAY ) return false ;
4599- } else if ( / % [ A a d e j u w x ] / . test ( tickformat ) ) {
4600- if ( period < ONEDAY ) return false ;
4601- } else if ( / % [ U V W ] / . test ( tickformat ) ) {
4602- if ( period < ONEWEEK ) return false ;
4603- } else if ( / % [ B b m ] / . test ( tickformat ) ) {
4604- if ( period < ONEMINMONTH ) return false ;
4605- } else if ( / % [ q ] / . test ( tickformat ) ) {
4606- if ( period < ONEMINQUARTER ) return false ;
4607- } else if ( / % [ Y y ] / . test ( tickformat ) ) {
4608- if ( period < ONEMINYEAR ) return false ;
4609- }
4610- return true ;
4587+ return (
4588+ / % f / . test ( tickformat ) ? period >= ONEMICROSEC :
4589+ / % L / . test ( tickformat ) ? period >= 1 :
4590+ / % [ S X ] / . test ( tickformat ) ? period >= ONESEC :
4591+ / % M / . test ( tickformat ) ? period >= ONEMIN :
4592+ / % [ H I ] / . test ( tickformat ) ? period >= ONEHOUR :
4593+ / % p / . test ( tickformat ) ? period >= HALFDAY :
4594+ / % [ A a d e j u w x ] / . test ( tickformat ) ? period >= ONEDAY :
4595+ / % [ U V W ] / . test ( tickformat ) ? period >= ONEWEEK :
4596+ / % [ B b m ] / . test ( tickformat ) ? period >= ONEMINMONTH :
4597+ / % [ q ] / . test ( tickformat ) ? period >= ONEMINQUARTER :
4598+ / % [ Y y ] / . test ( tickformat ) ? period >= ONEMINYEAR :
4599+ true
4600+ ) ;
46114601}
0 commit comments