~ubuntu-branches/ubuntu/lucid/beagle/lucid

« back to all changes in this revision

Viewing changes to search/Tiles/Utils.cs

  • Committer: Bazaar Package Importer
  • Author(s): Emilio Pozuelo Monfort
  • Date: 2007-12-24 17:25:05 UTC
  • mfrom: (1.1.18 upstream)
  • Revision ID: james.westby@ubuntu.com-20071224172505-a5wsz6kdesm45vre
Tags: 0.3.1-2ubuntu1
* Merge from Debian unstable, remaining Ubuntu changes:
  - debian/control:
    + Rename iceweasel-beagle and icedove-beagle to mozilla-beagle and
      thunderbird-beagle, change the Recommends to Depends and update
      them accordingly.
    + Suggest schedutils for beagle.
    + Change Maintainer to Ubuntu Mono Team.
  - debian/rules:
    + Install the mozilla-beagle and thunderbird-beagle extensions.
  - ice{dove,weasel}.dirs:
    + Renamed to {mozilla,thunderbird}-beagle.dirs.
    + Fixed paths to point to usr/lib/{firefox,thunderbird}

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
                                return hit.GetFirstProperty ("parent:" + prop);
104
104
                }
105
105
 
 
106
                public static string TrimFirstLine (string text)
 
107
                {
 
108
                        int newline = text.IndexOf ('\n');
 
109
 
 
110
                        if (newline == -1)
 
111
                                return text;
 
112
 
 
113
                        return String.Format ("{0}...", text.Substring (0, newline));
 
114
                }
 
115
 
106
116
                private static DateTimeFormatInfo DateTimeFormat = CultureInfo.CurrentCulture.DateTimeFormat;
107
117
                private static string ShortMonthDayPattern = DateTimeFormat.MonthDayPattern.Replace ("MMMM", "MMM");
108
118
                private static string ShortYearMonthPattern = DateTimeFormat.YearMonthPattern.Replace ("MMMM", "MMM");
233
243
                        else
234
244
                                return String.Format (Catalog.GetPluralString ("In {0} year", "In {0} years", span.Days / 365) + " ({1:MMMM d, yyyy})", span.Days / 365, dt);
235
245
                }
 
246
 
 
247
                public static string NiceShortTime (DateTime dt)
 
248
                {
 
249
                        return StringFu.DateTimeToPrettyString (dt.ToLocalTime ());
 
250
                }
 
251
 
 
252
                public static string NiceShortTime (string timestamp)
 
253
                {
 
254
                        DateTime dt;
 
255
 
 
256
                        try {
 
257
                                dt = StringFu.StringToDateTime (timestamp);
 
258
 
 
259
                        } catch {
 
260
                                return "";
 
261
                        }
 
262
 
 
263
                        return NiceShortTime (dt);
 
264
                }
236
265
        }
237
266
}