Fix bug with TODAY in Wikidata schema
This commit is contained in:
parent
1046c38727
commit
ae41348e00
@ -112,7 +112,7 @@ public class WbDateConstant implements WbExpression<TimeValue> {
|
|||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
TimeValue todaysDate = Datamodel.makeTimeValue(
|
TimeValue todaysDate = Datamodel.makeTimeValue(
|
||||||
calendar.get(Calendar.YEAR),
|
calendar.get(Calendar.YEAR),
|
||||||
(byte)calendar.get(Calendar.MONTH),
|
(byte)(calendar.get(Calendar.MONTH)+1),
|
||||||
(byte)calendar.get(Calendar.DAY_OF_MONTH),
|
(byte)calendar.get(Calendar.DAY_OF_MONTH),
|
||||||
(byte)0, (byte)0, (byte)0, (byte)11, 0,0,0, TimeValue.CM_GREGORIAN_PRO);
|
(byte)0, (byte)0, (byte)0, (byte)11, 0,0,0, TimeValue.CM_GREGORIAN_PRO);
|
||||||
return todaysDate;
|
return todaysDate;
|
||||||
|
@ -95,7 +95,7 @@ public class WbDateConstantTest extends WbExpressionTest<TimeValue> {
|
|||||||
TimeValue expectedDate = Datamodel.makeTimeValue(
|
TimeValue expectedDate = Datamodel.makeTimeValue(
|
||||||
calendar.get(Calendar.YEAR),
|
calendar.get(Calendar.YEAR),
|
||||||
(byte)calendar.get(Calendar.MONTH),
|
(byte)calendar.get(Calendar.MONTH),
|
||||||
(byte)calendar.get(Calendar.DAY_OF_MONTH),
|
(byte)(calendar.get(Calendar.DAY_OF_MONTH)+1),
|
||||||
(byte)0, (byte)0, (byte)0, (byte)11, 0,0,0, TimeValue.CM_GREGORIAN_PRO);
|
(byte)0, (byte)0, (byte)0, (byte)11, 0,0,0, TimeValue.CM_GREGORIAN_PRO);
|
||||||
evaluatesTo(expectedDate, new WbDateConstant("TODAY"));
|
evaluatesTo(expectedDate, new WbDateConstant("TODAY"));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user