Headless CMS and Content Managment Hub
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

55 lines
1.8 KiB

// ==========================================================================
// DateTimeFieldPropertiesDto.cs
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex Group
// All rights reserved.
// ==========================================================================
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using NJsonSchema.Annotations;
using NodaTime;
using Squidex.Domain.Apps.Core.Schemas;
using Squidex.Infrastructure.Reflection;
namespace Squidex.Areas.Api.Controllers.Schemas.Models.Fields
{
[JsonSchema("DateTime")]
public sealed class DateTimeFieldPropertiesDto : FieldPropertiesDto
{
/// <summary>
/// The default value for the field value.
/// </summary>
public Instant? DefaultValue { get; set; }
/// <summary>
/// The maximum allowed value for the field value.
/// </summary>
public Instant? MaxValue { get; set; }
/// <summary>
/// The minimum allowed value for the field value.
/// </summary>
public Instant? MinValue { get; set; }
/// <summary>
/// The editor that is used to manage this field.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public DateTimeFieldEditor Editor { get; set; }
/// <summary>
/// The calculated default value for the field value.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public DateTimeCalculatedDefaultValue? CalculatedDefaultValue { get; set; }
public override FieldProperties ToProperties()
{
var result = SimpleMapper.Map(this, new DateTimeFieldProperties());
return result;
}
}
}