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()
9797 PreviewImage = await Main . Context . API . LoadImageAsync ( FilePath , true ) . ConfigureAwait ( false ) ;
9898 }
9999
100- private string GetFileAge ( DateTime fileDateTime )
100+ private static string GetFileAge ( DateTime fileDateTime )
101101 {
102- DateTime now = DateTime . Now ;
103- TimeSpan difference = now - fileDateTime ;
102+ var now = DateTime . Now ;
103+ var difference = now - fileDateTime ;
104104
105105 if ( difference . TotalDays < 1 )
106106 return "Today" ;
107107 if ( difference . TotalDays < 30 )
108108 return $ "{ ( int ) difference . TotalDays } days ago";
109109
110- int monthsDiff = ( now . Year - fileDateTime . Year ) * 12 + now . Month - fileDateTime . Month ;
110+ var monthsDiff = ( now . Year - fileDateTime . Year ) * 12 + now . Month - fileDateTime . Month ;
111111 if ( monthsDiff < 12 )
112112 return monthsDiff == 1 ? "1 month ago" : $ "{ monthsDiff } months ago";
113113
114- int yearsDiff = now . Year - fileDateTime . Year ;
114+ var yearsDiff = now . Year - fileDateTime . Year ;
115115 if ( now . Month < fileDateTime . Month || ( now . Month == fileDateTime . Month && now . Day < fileDateTime . Day ) )
116116 yearsDiff -- ;
117117
118118 return yearsDiff == 1 ? "1 year ago" : $ "{ yearsDiff } years ago";
119119 }
120+
120121 public event PropertyChangedEventHandler ? PropertyChanged ;
121122
122123 protected virtual void OnPropertyChanged ( [ CallerMemberName ] string ? propertyName = null )
You can’t perform that action at this time.
0 commit comments