From 1a726b496201e035c29e342bd48f82e8a831030d Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Fri, 11 Aug 2023 15:43:06 +0100 Subject: [PATCH] style: format url as yyyy/MM/dd --- OliverBooth/Areas/Blog/Pages/Index.cshtml.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OliverBooth/Areas/Blog/Pages/Index.cshtml.cs b/OliverBooth/Areas/Blog/Pages/Index.cshtml.cs index 05971d5..6d4d1e7 100644 --- a/OliverBooth/Areas/Blog/Pages/Index.cshtml.cs +++ b/OliverBooth/Areas/Blog/Pages/Index.cshtml.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using OliverBooth.Data.Blog; using OliverBooth.Services; @@ -41,9 +41,9 @@ public class Index : PageModel var route = new { area = "blog", - year = post.Published.Year, - month = post.Published.Month, - day = post.Published.Day, + year = post.Published.ToString("yyyy"), + month = post.Published.ToString("MM"), + day = post.Published.ToString("dd"), slug = post.Slug }; return Redirect(Url.Page("/Article", route)!);