feat: handle timezones and conversions with NodaTime
This commit is contained in:
@ -1,29 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Oqtane.Models;
|
||||
using Oqtane.Shared;
|
||||
|
||||
namespace Oqtane.Controllers
|
||||
{
|
||||
[Route(ControllerRoutes.ApiRoute)]
|
||||
public class TimeZoneController : Controller
|
||||
{
|
||||
public TimeZoneController() {}
|
||||
|
||||
// GET: api/<controller>
|
||||
[HttpGet]
|
||||
public IEnumerable<Models.TimeZone> Get()
|
||||
{
|
||||
return TimeZoneInfo.GetSystemTimeZones()
|
||||
.Select(item => new Models.TimeZone
|
||||
{
|
||||
Id = item.Id,
|
||||
DisplayName = item.DisplayName
|
||||
})
|
||||
.OrderBy(item => item.DisplayName);
|
||||
}
|
||||
}
|
||||
}
|
@ -104,7 +104,6 @@ namespace Microsoft.Extensions.DependencyInjection
|
||||
services.AddScoped<ISearchProvider, DatabaseSearchProvider>();
|
||||
services.AddScoped<IImageService, ImageService>();
|
||||
services.AddScoped<ICookieConsentService, ServerCookieConsentService>();
|
||||
services.AddScoped<ITimeZoneService, TimeZoneService>();
|
||||
|
||||
// providers
|
||||
services.AddScoped<ITextEditor, Oqtane.Modules.Controls.QuillJSTextEditor>();
|
||||
|
Reference in New Issue
Block a user