File tree Expand file tree Collapse file tree
headless/server/src/main/java/com/tencent/supersonic/headless/server/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -448,9 +448,20 @@ private String generateDictDateFilter(DictItemResp dictItemResp) {
448448
449449 // 静态日期
450450 if (DateConf .DateMode .BETWEEN .equals (config .getDateConf ().getDateMode ())) {
451+ String dateFormat = partitionTimeDimension .getDateFormat ();
452+ if (StringUtils .isEmpty (dateFormat )) {
453+ dateFormat = "yyyy-MM-dd" ; // 默认格式
454+ }
455+
456+ // 格式化起止日期
457+ DateTimeFormatter formatter = DateTimeFormatter .ofPattern (dateFormat );
458+ String startDate =
459+ LocalDate .parse (config .getDateConf ().getStartDate ()).format (formatter );
460+ String endDate = LocalDate .parse (config .getDateConf ().getEndDate ()).format (formatter );
461+
451462 return String .format ("( %s >= '%s' and %s <= '%s' )" ,
452- partitionTimeDimension .getBizName (), config . getDateConf (). getStartDate () ,
453- partitionTimeDimension .getBizName (), config . getDateConf (). getEndDate () );
463+ partitionTimeDimension .getBizName (), startDate ,
464+ partitionTimeDimension .getBizName (), endDate );
454465 }
455466
456467 // 动态日期
You can’t perform that action at this time.
0 commit comments