@@ -3365,15 +3365,22 @@ class PipelineIntegrationTests: FSTIntegrationTestCase {
33653365 . limit ( 1 )
33663366 . select (
33673367 [
3368- Constant ( baseTimestamp) . timestampTruncate ( granularity: " nanosecond " ) . as ( " truncNano " ) ,
33693368 Constant ( baseTimestamp) . timestampTruncate ( granularity: . microsecond) . as ( " truncMicro " ) ,
33703369 Constant ( baseTimestamp) . timestampTruncate ( granularity: . millisecond) . as ( " truncMilli " ) ,
33713370 Constant ( baseTimestamp) . timestampTruncate ( granularity: . second) . as ( " truncSecond " ) ,
33723371 Constant ( baseTimestamp) . timestampTruncate ( granularity: . minute) . as ( " truncMinute " ) ,
33733372 Constant ( baseTimestamp) . timestampTruncate ( granularity: . hour) . as ( " truncHour " ) ,
33743373 Constant ( baseTimestamp) . timestampTruncate ( granularity: . day) . as ( " truncDay " ) ,
3375- Constant ( baseTimestamp) . timestampTruncate ( granularity: " month " ) . as ( " truncMonth " ) ,
3376- Constant ( baseTimestamp) . timestampTruncate ( granularity: " year " ) . as ( " truncYear " ) ,
3374+ Constant ( baseTimestamp) . timestampTruncate ( granularity: . week) . as ( " truncWeek " ) ,
3375+ Constant ( baseTimestamp) . timestampTruncate ( granularity: . weekMonday) . as ( " truncWeekMonday " ) ,
3376+ Constant ( baseTimestamp) . timestampTruncate ( granularity: . weekTuesday)
3377+ . as ( " truncWeekTuesday " ) ,
3378+ Constant ( baseTimestamp) . timestampTruncate ( granularity: . isoweek) . as ( " truncIsoWeek " ) ,
3379+ Constant ( baseTimestamp) . timestampTruncate ( granularity: . month) . as ( " truncMonth " ) ,
3380+ Constant ( baseTimestamp) . timestampTruncate ( granularity: . quarter) . as ( " truncQuarter " ) ,
3381+ Constant ( baseTimestamp) . timestampTruncate ( granularity: . year) . as ( " truncYear " ) ,
3382+ Constant ( baseTimestamp) . timestampTruncate ( granularity: . isoyear) . as ( " truncIsoYear " ) ,
3383+ Constant ( baseTimestamp) . timestampTruncate ( granularity: " day " ) . as ( " truncDayString " ) ,
33773384 Constant ( baseTimestamp) . timestampTruncate ( granularity: Constant ( " day " ) )
33783385 . as ( " truncDayExpr " ) ,
33793386 ]
@@ -3384,16 +3391,22 @@ class PipelineIntegrationTests: FSTIntegrationTestCase {
33843391 XCTAssertEqual ( snapshot. results. count, 1 , " Should retrieve one document " )
33853392
33863393 let expectedResults : [ String : Timestamp ] = [
3387- " truncNano " : Timestamp ( seconds: 1_741_380_235 , nanoseconds: 123_456_000 ) ,
33883394 " truncMicro " : Timestamp ( seconds: 1_741_380_235 , nanoseconds: 123_456_000 ) ,
33893395 " truncMilli " : Timestamp ( seconds: 1_741_380_235 , nanoseconds: 123_000_000 ) ,
33903396 " truncSecond " : Timestamp ( seconds: 1_741_380_235 , nanoseconds: 0 ) ,
33913397 " truncMinute " : Timestamp ( seconds: 1_741_380_180 , nanoseconds: 0 ) ,
33923398 " truncHour " : Timestamp ( seconds: 1_741_377_600 , nanoseconds: 0 ) ,
3393- " truncDay " : Timestamp ( seconds: 1_741_305_600 , nanoseconds: 0 ) , // Assuming UTC day start
3394- " truncMonth " : Timestamp ( seconds: 1_740_787_200 , nanoseconds: 0 ) , // Assuming UTC month start
3395- " truncYear " : Timestamp ( seconds: 1_735_689_600 , nanoseconds: 0 ) , // Assuming UTC year start
3396- " truncDayExpr " : Timestamp ( seconds: 1_741_305_600 , nanoseconds: 0 ) , // Assuming UTC day start
3399+ " truncDay " : Timestamp ( seconds: 1_741_305_600 , nanoseconds: 0 ) ,
3400+ " truncWeek " : Timestamp ( seconds: 1_740_873_600 , nanoseconds: 0 ) ,
3401+ " truncWeekMonday " : Timestamp ( seconds: 1_740_960_000 , nanoseconds: 0 ) ,
3402+ " truncWeekTuesday " : Timestamp ( seconds: 1_741_046_400 , nanoseconds: 0 ) ,
3403+ " truncIsoWeek " : Timestamp ( seconds: 1_740_960_000 , nanoseconds: 0 ) ,
3404+ " truncMonth " : Timestamp ( seconds: 1_740_787_200 , nanoseconds: 0 ) ,
3405+ " truncQuarter " : Timestamp ( seconds: 1_735_689_600 , nanoseconds: 0 ) ,
3406+ " truncYear " : Timestamp ( seconds: 1_735_689_600 , nanoseconds: 0 ) ,
3407+ " truncIsoYear " : Timestamp ( seconds: 1_735_516_800 , nanoseconds: 0 ) ,
3408+ " truncDayString " : Timestamp ( seconds: 1_741_305_600 , nanoseconds: 0 ) ,
3409+ " truncDayExpr " : Timestamp ( seconds: 1_741_305_600 , nanoseconds: 0 ) ,
33973410 ]
33983411
33993412 if let resultDoc = snapshot. results. first {
0 commit comments