DateRange
Log in to add to favouritesThe DateRange type represents a start and end point in time.
Properties
Name | Type | Description |
---|---|---|
From | DateTime? | The datetime the range starts |
To | DateTime? | The datetime the range ends |
Remarks
The From and To properties are of type nullable DateTime and can be partly set.
Validation
The From value cannot be a later date than the To value.
Example
Get a DateRange field object
using Zengenti.Contensis.Delivery;
// Create an API client
var client = ContensisClient.Create();
// Retrieve a movie by it's ID.
var movie = client.Entries.Get("0aabad4e-a083-4a88-bd75-b2674e2f8298");
// Get the field value as a DateRange instance.
var filmingPeriod = movie.Get<DateRange>("filmingPeriod");
<span class="start">@filmingPeriod.From</span>
<span class="end">@filmingPeriod.To</span>