File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Plugins/Flow.Launcher.Plugin.Explorer/Views Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -97,26 +97,27 @@ private async Task LoadImageAsync()
97
97
PreviewImage = await Main . Context . API . LoadImageAsync ( FilePath , true ) . ConfigureAwait ( false ) ;
98
98
}
99
99
100
- private string GetFileAge ( DateTime fileDateTime )
100
+ private static string GetFileAge ( DateTime fileDateTime )
101
101
{
102
- DateTime now = DateTime . Now ;
103
- TimeSpan difference = now - fileDateTime ;
102
+ var now = DateTime . Now ;
103
+ var difference = now - fileDateTime ;
104
104
105
105
if ( difference . TotalDays < 1 )
106
106
return "Today" ;
107
107
if ( difference . TotalDays < 30 )
108
108
return $ "{ ( int ) difference . TotalDays } days ago";
109
109
110
- int monthsDiff = ( now . Year - fileDateTime . Year ) * 12 + now . Month - fileDateTime . Month ;
110
+ var monthsDiff = ( now . Year - fileDateTime . Year ) * 12 + now . Month - fileDateTime . Month ;
111
111
if ( monthsDiff < 12 )
112
112
return monthsDiff == 1 ? "1 month ago" : $ "{ monthsDiff } months ago";
113
113
114
- int yearsDiff = now . Year - fileDateTime . Year ;
114
+ var yearsDiff = now . Year - fileDateTime . Year ;
115
115
if ( now . Month < fileDateTime . Month || ( now . Month == fileDateTime . Month && now . Day < fileDateTime . Day ) )
116
116
yearsDiff -- ;
117
117
118
118
return yearsDiff == 1 ? "1 year ago" : $ "{ yearsDiff } years ago";
119
119
}
120
+
120
121
public event PropertyChangedEventHandler ? PropertyChanged ;
121
122
122
123
protected virtual void OnPropertyChanged ( [ CallerMemberName ] string ? propertyName = null )
You can’t perform that action at this time.
0 commit comments