@@ -216,8 +216,8 @@ public async Task Test_UpdatePageProperty_with_date_as_null()
216
216
{
217
217
Date = new Date
218
218
{
219
- Start = Convert . ToDateTime ( "2020-12-08T12 :00:00Z ") ,
220
- End = Convert . ToDateTime ( "2025-12-08T12:00:00Z" )
219
+ Start = DateTimeOffset . Parse ( "2024-06-26T00 :00:00.000+01:00 ") ,
220
+ End = DateTimeOffset . Parse ( "2025-12-08" ) . Date
221
221
}
222
222
} )
223
223
. Build ( ) ;
@@ -236,7 +236,8 @@ public async Task Test_UpdatePageProperty_with_date_as_null()
236
236
) ;
237
237
238
238
// Assert
239
- setDate ? . Date ? . Start . Should ( ) . Be ( Convert . ToDateTime ( "2020-12-08T12:00:00Z" ) ) ;
239
+ setDate ? . Date ? . Start . Should ( ) . Be ( DateTimeOffset . Parse ( "2024-06-26T00:00:00.000+01:00" ) ) ;
240
+ setDate ? . Date ? . End . Should ( ) . Be ( DateTimeOffset . Parse ( "2025-12-08T00:00:00.000+01:00" ) ) ;
240
241
241
242
var pageUpdateParameters = new PagesUpdateParameters
242
243
{
@@ -384,4 +385,58 @@ public async Task Bug_exception_when_attempting_to_set_select_property_to_nothin
384
385
updatedPage . Properties [ "Colors1" ] . As < SelectPropertyValue > ( ) . Select . Name . Should ( ) . Be ( "Blue" ) ;
385
386
updatedPage . Properties [ "Colors2" ] . As < SelectPropertyValue > ( ) . Select . Should ( ) . BeNull ( ) ;
386
387
}
388
+
389
+ [ Fact ]
390
+ public async Task Verify_date_property_is_parsed_correctly_in_mention_object ( )
391
+ {
392
+ var pageRequest = PagesCreateParametersBuilder
393
+ . Create ( new DatabaseParentInput { DatabaseId = _database . Id } )
394
+ . AddProperty ( "Name" ,
395
+ new TitlePropertyValue
396
+ {
397
+ Title = new List < RichTextBase >
398
+ {
399
+ new RichTextMention ( )
400
+ {
401
+ Mention = new Mention ( )
402
+ {
403
+ Page = new ObjectId ( )
404
+ {
405
+ Id = _page . Id ,
406
+ } ,
407
+ Date = new DatePropertyValue ( )
408
+ {
409
+ Date = new Date ( )
410
+ {
411
+ Start = DateTime . UtcNow
412
+ }
413
+ }
414
+ }
415
+ }
416
+ }
417
+ } )
418
+ . Build ( ) ;
419
+
420
+ var page = await Client . Pages . CreateAsync ( pageRequest ) ;
421
+
422
+ page . Should ( ) . NotBeNull ( ) ;
423
+
424
+ page . Parent . Should ( ) . BeOfType < DatabaseParent > ( ) . Which
425
+ . DatabaseId . Should ( ) . Be ( _database . Id ) ;
426
+
427
+ page . Properties . Should ( ) . ContainKey ( "Name" ) ;
428
+ var pageProperty = page . Properties [ "Name" ] . Should ( ) . BeOfType < TitlePropertyValue > ( ) . Subject ;
429
+
430
+ var titleProperty = ( ListPropertyItem ) await Client . Pages . RetrievePagePropertyItemAsync (
431
+ new RetrievePropertyItemParameters
432
+ {
433
+ PageId = page . Id ,
434
+ PropertyId = pageProperty . Id
435
+ } ) ;
436
+
437
+ titleProperty . Results . First ( )
438
+ . As < TitlePropertyItem > ( )
439
+ . Title . As < RichTextMention > ( )
440
+ . Mention . Date . Date . Should ( ) . NotBeNull ( ) ;
441
+ }
387
442
}
0 commit comments