File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
src/web/Client/Extensions Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 1
- using System . Globalization ;
2
-
3
1
namespace Jordnaer . Client . Extensions ;
4
2
5
3
public static class DateTimeExtensions
6
4
{
7
- public static string DisplayExactTime ( this DateTime date ) =>
8
- $ "afsendt { date . ToLocalTime ( ) . ToString ( "d/M yyyy kl. HH:mm" , new CultureInfo ( "da-DK" ) ) } ";
5
+ public static string DisplayExactTime ( this DateTime date ) =>
6
+ // Example of this format: 1/9 2017 kl. 07:45
7
+ $ "afsendt { date . ToLocalTime ( ) : d/M yyyy kl. HH:mm} ";
9
8
10
9
public static string DisplayTimePassed ( this DateTime date )
11
10
{
@@ -46,10 +45,14 @@ public static string DisplayTimePassed(this DateTime date)
46
45
int weeks = ( int ) Math . Floor ( timeSpan . TotalDays / 7 ) ;
47
46
48
47
if ( weeks is 1 )
48
+ {
49
49
return "sendt i sidste uge" ;
50
+ }
50
51
51
52
if ( timeSpan . TotalDays < 365 )
53
+ {
52
54
return $ "sendt for { weeks } uger siden";
55
+ }
53
56
54
57
return $ "afsendt { date . ToLocalTime ( ) : dd/MM/yyyy HH:mm:ss} ";
55
58
}
You can’t perform that action at this time.
0 commit comments