Merge branch 'main' into feature/ios

This commit is contained in:
2026-04-21 10:41:13 +09:00
16 changed files with 225 additions and 34 deletions
+20 -1
View File
@@ -1,15 +1,34 @@
using System.Collections.Generic;
using MayShow.Models;
namespace MayShow.Helpers;
class Constants
{
public static string AppVersion = "1.4.2";
public static string AppVersion = "1.4.3";
public static string[] AllowedFileExtensionPatterns = [ "*.png", "*.jpg", "*.jpeg", "*.gif", "*.bmp", "*.webp", "*.pdf", "*.heic", ];
public static string[] AllowedFileExtensionsNoStar = [ "png", "jpg", "jpeg", "gif", "bmp", "webp", "pdf", "heic", ];
public static string ReportSavedDataFileName = "report_data.json";
public static List<DateDisplayFormat> GetDateDisplayFormats()
{
return [
new DateDisplayFormat("Month/Day/Year", "4/5/2026", "M/d/yyyy"),
new DateDisplayFormat("Year-Month-Day", "2026-04-05", "yyyy-MM-dd"),
new DateDisplayFormat("Month Day, Year", "April 5, 2026", "MMMM d, yyyy"),
new DateDisplayFormat("DOW, Month Day, Year", "Sunday, April 5, 2026", "dddd, MMMM d, yyyy"),
new DateDisplayFormat("Abbreviated-Month Day, Year", "Apr 5, 2026", "MMM d, yyyy"),
new DateDisplayFormat("DOW, Abbreviated-Month Day, Year", "Sunday, Apr 5, 2026", "dddd, MMM d, yyyy"),
new DateDisplayFormat("Day Month, Year", "5 April 2026", "d MMMM yyyy"),
new DateDisplayFormat("Day Abbreviated-Month, Year", "5 Apr 2026", "d MMM yyyy"),
new DateDisplayFormat("Day Month, Year", "05 April 2026", "dd MMMM yyyy"),
new DateDisplayFormat("Day Abbreviated-Month, Year", "05 Apr 2026", "dd MMM yyyy"),
];
}
public static string[] GetQuotes()
{
// sources:
@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using Avalonia.Data.Converters;
namespace MayShow.Helpers;
public class DateFormatConverter : IMultiValueConverter
{
public object? Convert(
IList<object?> values,
Type targetType,
object? parameter,
CultureInfo culture)
{
if (values.Count >= 2 && values[0] is DateOnly date && values[1] is string format)
{
return date.ToString(format);
}
if (values.Count >= 2 && values[0] is string dateFormat && values[1] is DateOnly dateOnly)
{
return dateOnly.ToString(dateFormat);
}
if (values.Count >= 2 && values[0] is DateTime dateTime && values[1] is string format3)
{
return dateTime.ToString(format3);
}
if (values.Count >= 2 && values[0] is string format4 && values[1] is DateTime dateTime2)
{
return dateTime2.ToString(format4);
}
return "";
}
}
+1 -1
View File
@@ -2,7 +2,7 @@ using System;
using System.Collections.Generic;
using System.Threading;
namespace MayShows.Helpers;
namespace MayShow.Helpers;
public static class ThreadSafeRandom
{
+1 -1
View File
@@ -9,7 +9,7 @@ using System.Text.RegularExpressions;
using MayShow.Models;
using Tmds.DBus.Protocol;
namespace MayShows.Helpers;
namespace MayShow.Helpers;
class Utilities
{