public async Task <string> GetDateStringAsync(DateTimeOffset?date, DateStringFormat format = DateStringFormat.Long) { if (date.HasValue) { if (Config.GenerationsEnabled) { IGeneration gen = await Db.GetGenerationByDateAsync(date.Value); return(gen is null ? "Gen ???" : gen.Name); } return(DateUtilities.GetDateString(date.Value, format)); } else { return("???"); } }
private string _timestampToString(long timestamp) { return(TimestampFormatter is null?DateUtilities.GetDateString(timestamp, DateStringFormat.Short) : TimestampFormatter(timestamp)); }