@@ -28,29 +28,34 @@ public ITimeSpanLabel ToTimeSpanLabel(DateTimeOffset offset, GroupByDateUnit uni
2828 return 0 switch
2929 {
3030 _ when now . Date < time . Date
31- => new Label ( "Future" . GetLocalizedResource ( ) , "\uED28 " , 1000006 ) ,
31+ => new Label ( "Future" . GetLocalizedResource ( ) , "\uED28 " , 1000000006 ) ,
3232 _ when now . Date == time . Date
33- => new Label ( "Today" . GetLocalizedResource ( ) , "\uE8D1 " , 1000005 ) ,
33+ => new Label ( "Today" . GetLocalizedResource ( ) , "\uE8D1 " , 1000000005 ) ,
3434 _ when now . AddDays ( - 1 ) . Date == time . Date
35- => new Label ( "Yesterday" . GetLocalizedResource ( ) , "\uE8BF " , 1000004 ) ,
35+ => new Label ( "Yesterday" . GetLocalizedResource ( ) , "\uE8BF " , 1000000004 ) ,
36+
37+ // Group by day
38+ _ when unit == GroupByDateUnit . Day
39+ => new Label ( ToString ( time , "D" ) , "\uE8BF " , time . Year * 10000 + time . Month * 100 + time . Day ) ,
40+
3641 _ when diff . Days <= 7 && GetWeekOfYear ( now ) == GetWeekOfYear ( time )
37- => new Label ( "EarlierThisWeek" . GetLocalizedResource ( ) , "\uE8C0 " , 1000003 ) ,
42+ => new Label ( "EarlierThisWeek" . GetLocalizedResource ( ) , "\uE8C0 " , 1000000003 ) ,
3843 _ when diff . Days <= 14 && GetWeekOfYear ( now . AddDays ( - 7 ) ) == GetWeekOfYear ( time )
39- => new Label ( "LastWeek" . GetLocalizedResource ( ) , "\uE8C0 " , 1000002 ) ,
44+ => new Label ( "LastWeek" . GetLocalizedResource ( ) , "\uE8C0 " , 1000000002 ) ,
4045 _ when now . Year == time . Year && now . Month == time . Month
41- => new Label ( "EarlierThisMonth" . GetLocalizedResource ( ) , "\uE787 " , 1000001 ) ,
46+ => new Label ( "EarlierThisMonth" . GetLocalizedResource ( ) , "\uE787 " , 1000000001 ) ,
4247 _ when now . AddMonths ( - 1 ) . Year == time . Year && now . AddMonths ( - 1 ) . Month == time . Month
43- => new Label ( "LastMonth" . GetLocalizedResource ( ) , "\uE787 " , 1000000 ) ,
48+ => new Label ( "LastMonth" . GetLocalizedResource ( ) , "\uE787 " , 1000000000 ) ,
4449
4550 // Group by month
4651 _ when unit == GroupByDateUnit . Month
47- => new Label ( ToString ( time , "Y" ) , "\uE787 " , time . Year * 100 + time . Month ) ,
52+ => new Label ( ToString ( time , "Y" ) , "\uE787 " , time . Year * 10000 + time . Month * 100 ) ,
4853
4954 // Group by year
5055 _ when now . Year == time . Year
51- => new Label ( "EarlierThisYear" . GetLocalizedResource ( ) , "\uEC92 " , 10001 ) ,
56+ => new Label ( "EarlierThisYear" . GetLocalizedResource ( ) , "\uEC92 " , 10000001 ) ,
5257 _ when now . AddYears ( - 1 ) . Year == time . Year
53- => new Label ( "LastYear" . GetLocalizedResource ( ) , "\uEC92 " , 10000 ) ,
58+ => new Label ( "LastYear" . GetLocalizedResource ( ) , "\uEC92 " , 10000000 ) ,
5459 _
5560 => new Label ( string . Format ( "YearN" . GetLocalizedResource ( ) , time . Year ) , "\uEC92 " , time . Year ) ,
5661 } ;
0 commit comments