summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpshi2011-11-24 03:45:16 (EST)
committer mwu2011-11-24 03:45:16 (EST)
commit7277aaffe45f1145af9a929d1eb1b0afeea37397 (patch)
tree2d154e7d6ffc260d6c62bd8c875fd9623a6e6dc5
parent0faa1b1d413d21c592bcd9c8bb42725870b12e2e (diff)
downloadorg.eclipse.birt-7277aaffe45f1145af9a929d1eb1b0afeea37397.zip
org.eclipse.birt-7277aaffe45f1145af9a929d1eb1b0afeea37397.tar.gz
org.eclipse.birt-7277aaffe45f1145af9a929d1eb1b0afeea37397.tar.bz2
make the time level sorted in UI as (year,quarter,month,week,day)
-rw-r--r--data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/api/timeFunction/TimeFunctionManager.java19
1 files changed, 10 insertions, 9 deletions
diff --git a/data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/api/timeFunction/TimeFunctionManager.java b/data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/api/timeFunction/TimeFunctionManager.java
index 4492491..ec36e8a 100644
--- a/data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/api/timeFunction/TimeFunctionManager.java
+++ b/data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/api/timeFunction/TimeFunctionManager.java
@@ -140,24 +140,25 @@ public class TimeFunctionManager
periodType.add( IArgumentInfo.Period_Type.MONTH );
}
- if ( timeType.contains( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_DAY_OF_YEAR ) )
- {
- availableFunctions.add( handle.getFunction( IBuildInBaseTimeFunction.TRAILING_30_DAYS ) );
- availableFunctions.add( handle.getFunction( IBuildInBaseTimeFunction.TRAILING_60_DAYS ) );
- availableFunctions.add( handle.getFunction( IBuildInBaseTimeFunction.TRAILING_90_DAYS ) );
- availableFunctions.add( handle.getFunction( IBuildInBaseTimeFunction.TRAILING_120_DAYS ) );
- periodType.add( IArgumentInfo.Period_Type.DAY );
- }
+
// for WTD, only support static reference date
if ( timeLevelsInXtab.isEmpty( )
&& ( timeType.contains( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_WEEK_OF_YEAR ) ) )
{
availableFunctions.add( handle.getFunction( IBuildInBaseTimeFunction.WEEK_TO_DATE ) );
availableFunctions.add( handle.getFunction( IBuildInBaseTimeFunction.PREVIOUS_WEEK_TO_DATE ) );
- availableFunctions.add( handle.getFunction( IBuildInBaseTimeFunction.WEEK_TO_DATE_LAST_YEAR) );
+ availableFunctions.add( handle.getFunction( IBuildInBaseTimeFunction.WEEK_TO_DATE_LAST_YEAR ) );
periodType.add( IArgumentInfo.Period_Type.WEEK );
}
+ if ( timeType.contains( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_DAY_OF_YEAR ) )
+ {
+ availableFunctions.add( handle.getFunction( IBuildInBaseTimeFunction.TRAILING_30_DAYS ) );
+ availableFunctions.add( handle.getFunction( IBuildInBaseTimeFunction.TRAILING_60_DAYS ) );
+ availableFunctions.add( handle.getFunction( IBuildInBaseTimeFunction.TRAILING_90_DAYS ) );
+ availableFunctions.add( handle.getFunction( IBuildInBaseTimeFunction.TRAILING_120_DAYS ) );
+ periodType.add( IArgumentInfo.Period_Type.DAY );
+ }
availableFunctions.add( new BaseTimeFunction( handle.getFunction( IBuildInBaseTimeFunction.CURRENT_PERIOD_FROM_N_PERIOD_AGO ),
periodType ) );
availableFunctions.add( new BaseTimeFunction( handle.getFunction( IBuildInBaseTimeFunction.PERIOD_TO_DATE_FROM_N_PERIOD_AGO ),