1 16 package org.outerj.daisy.query.model.functions; 17 18 import org.outerj.daisy.query.model.QValueType; 19 20 import java.util.Calendar ; 21 22 public class RelativeDateFunction extends RelativeDateTimeFunction { 23 public static final String NAME = "RelativeDate"; 24 25 public String getFunctionName() { 26 return NAME; 27 } 28 29 public QValueType getValueType() { 30 return QValueType.DATE; 31 } 32 33 public QValueType getOutputValueType() { 34 return QValueType.DATE; 35 } 36 37 protected Calendar calcDate(boolean start, int shift, int shiftUnit, int dayInShiftUnit) { 38 Calendar calendar = super.calcDate(start, shift, shiftUnit, dayInShiftUnit); 39 40 calendar.set(Calendar.HOUR_OF_DAY, 0); 42 calendar.set(Calendar.MINUTE, 0); 43 calendar.set(Calendar.SECOND, 0); 44 45 return calendar; 46 } 47 } 48 | Popular Tags |