1
1
using BlogEngine . Core . Data . Models ;
2
2
using System ;
3
3
using System . Collections . Generic ;
4
+ using System . Globalization ;
4
5
using System . Linq ;
5
6
6
7
namespace BlogEngine . Core . Data . Services
@@ -24,7 +25,7 @@ public static PostItem GetPost(Post post)
24
25
Title = post . Title ,
25
26
Slug = post . Slug ,
26
27
RelativeLink = post . RelativeLink ,
27
- DateCreated = post . DateCreated . ToString ( "yyyy-MM-dd HH:mm" ) ,
28
+ DateCreated = post . DateCreated . ToString ( "yyyy-MM-dd HH:mm" , CultureInfo . InvariantCulture ) ,
28
29
Categories = GetCategories ( post . Categories ) ,
29
30
Tags = GetTags ( post . Tags ) ,
30
31
Comments = GetComments ( post ) ,
@@ -47,7 +48,7 @@ public static PostDetail GetPostDetail(Post post)
47
48
Description = post . Description ,
48
49
RelativeLink = post . RelativeLink ,
49
50
Content = post . Content ,
50
- DateCreated = post . DateCreated . ToString ( "yyyy-MM-dd HH:mm" ) ,
51
+ DateCreated = post . DateCreated . ToString ( "yyyy-MM-dd HH:mm" , CultureInfo . InvariantCulture ) ,
51
52
Categories = GetCategories ( post . Categories ) ,
52
53
Tags = GetTags ( post . Tags ) ,
53
54
Comments = GetComments ( post ) ,
@@ -81,7 +82,7 @@ public static PageItem GetPage(Page page)
81
82
Slug = page . Slug ,
82
83
Parent = parentOption ,
83
84
Keywords = page . Keywords ,
84
- DateCreated = page . DateCreated . ToString ( "yyyy-MM-dd HH:mm" ) ,
85
+ DateCreated = page . DateCreated . ToString ( "yyyy-MM-dd HH:mm" , CultureInfo . InvariantCulture ) ,
85
86
HasChildren = page . HasChildPages ,
86
87
IsPublished = page . IsPublished ,
87
88
IsFrontPage = page . IsFrontPage ,
@@ -114,7 +115,7 @@ public static PageDetail GetPageDetail(Page page)
114
115
Parent = parentOption ,
115
116
Description = page . Description ,
116
117
Keywords = page . Keywords ,
117
- DateCreated = page . DateCreated . ToString ( "yyyy-MM-dd HH:mm" ) ,
118
+ DateCreated = page . DateCreated . ToString ( "yyyy-MM-dd HH:mm" , CultureInfo . InvariantCulture ) ,
118
119
HasChildren = page . HasChildPages ,
119
120
IsPublished = page . IsPublished ,
120
121
IsFrontPage = page . IsFrontPage ,
@@ -138,7 +139,7 @@ public static CommentItem GetComment(Comment c, List<Comment> postComments)
138
139
jc . Email = c . Email == "trackback" ? "pingback" : c . Email ;
139
140
jc . Author = c . Author ;
140
141
jc . Title = c . Teaser . Length < 80 ? c . Teaser : c . Teaser . Substring ( 0 , 80 ) + "..." ;
141
- jc . DateCreated = c . DateCreated . ToString ( "yyyy-MM-dd HH:mm" ) ;
142
+ jc . DateCreated = c . DateCreated . ToString ( "yyyy-MM-dd HH:mm" , CultureInfo . InvariantCulture ) ;
142
143
jc . RelativeLink = c . RelativeLink ;
143
144
jc . HasChildren = postComments . Where ( pc => pc . ParentId == c . Id ) . FirstOrDefault ( ) != null ;
144
145
jc . Avatar = Gravatar ( c ) ;
0 commit comments