Merge branch 'main' into feature/ios
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
using MayShow.Helpers;
|
||||
|
||||
namespace MayShow.Models;
|
||||
|
||||
class DateDisplayFormat : ChangeNotifier
|
||||
{
|
||||
private string _title;
|
||||
private string _example;
|
||||
private string _value;
|
||||
|
||||
public DateDisplayFormat(string title, string example, string value)
|
||||
{
|
||||
_title = title;
|
||||
_example = example;
|
||||
_value = value;
|
||||
}
|
||||
|
||||
public string Title
|
||||
{
|
||||
get => _title;
|
||||
set { _title = value; NotifyPropertyChanged(); }
|
||||
}
|
||||
|
||||
public string Example
|
||||
{
|
||||
get => _example;
|
||||
set { _example = value; NotifyPropertyChanged(); }
|
||||
}
|
||||
|
||||
public string Value
|
||||
{
|
||||
get => _value;
|
||||
set { _value = value; NotifyPropertyChanged(); }
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ class ReportFile : ChangeNotifier
|
||||
public ReportFile(ReportFile other)
|
||||
{
|
||||
Title = _title = other.Title;
|
||||
ReceiptDateTime = _receiptDateTime = other.ReceiptDateTime;
|
||||
ReceiptDateTime = _receiptDateTime = other.ReceiptDateTime ?? DateTime.Now;
|
||||
Notes = _notes = other.Notes;
|
||||
FilePath = _filePath = other.FilePath;
|
||||
}
|
||||
@@ -34,12 +34,12 @@ class ReportFile : ChangeNotifier
|
||||
set { _title = value; NotifyPropertyChanged(); }
|
||||
}
|
||||
|
||||
public DateTime ReceiptDateTime
|
||||
public DateTime? ReceiptDateTime
|
||||
{
|
||||
get => _receiptDateTime;
|
||||
set
|
||||
{
|
||||
_receiptDateTime = value;
|
||||
{
|
||||
_receiptDateTime = value ?? DateTime.Now;
|
||||
NotifyPropertyChanged();
|
||||
NotifyPropertyChanged(nameof(ReceiptDate));
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Threading.Tasks;
|
||||
using MayShow.Helpers;
|
||||
using MayShows.Helpers;
|
||||
|
||||
namespace MayShow.Models;
|
||||
|
||||
@@ -21,6 +20,8 @@ class Settings : ChangeNotifier
|
||||
private bool _saveReportJsonDataInInternalDir;
|
||||
private Dictionary<string, string> _workingFolderToInternalFolderName; // obsolete
|
||||
private List<PDFReportInfo> _allReportInfo;
|
||||
public string _dataGridDateFormat;
|
||||
public string _reportDateFormat;
|
||||
public int _settingsVersion;
|
||||
|
||||
public Settings() : base()
|
||||
@@ -34,6 +35,8 @@ class Settings : ChangeNotifier
|
||||
_workingFolderToInternalFolderName = [];
|
||||
_allReportInfo = [];
|
||||
_settingsVersion = 2;
|
||||
_dataGridDateFormat = "dd/MM/yyyy";
|
||||
_reportDateFormat = "yyyy-MM-dd";
|
||||
}
|
||||
|
||||
public Settings(Settings other)
|
||||
@@ -47,6 +50,8 @@ class Settings : ChangeNotifier
|
||||
_workingFolderToInternalFolderName = other.WorkingFolderToInternalFolderName;
|
||||
_settingsVersion = other.SettingsVersion;
|
||||
_allReportInfo = other.AllReportInfo;
|
||||
_dataGridDateFormat = other.DataGridDateFormat;
|
||||
_reportDateFormat = other.ReportDateFormat;
|
||||
}
|
||||
|
||||
[JsonInclude]
|
||||
@@ -113,6 +118,20 @@ class Settings : ChangeNotifier
|
||||
set { _settingsVersion = value; NotifyPropertyChanged(); }
|
||||
}
|
||||
|
||||
[JsonInclude]
|
||||
public string DataGridDateFormat
|
||||
{
|
||||
get => _dataGridDateFormat;
|
||||
set { _dataGridDateFormat = value; NotifyPropertyChanged(); }
|
||||
}
|
||||
|
||||
[JsonInclude]
|
||||
public string ReportDateFormat
|
||||
{
|
||||
get => _reportDateFormat;
|
||||
set { _reportDateFormat = value; NotifyPropertyChanged(); }
|
||||
}
|
||||
|
||||
public static string SettingsFileName = "settings.json";
|
||||
|
||||
public static string GetSettingsPath()
|
||||
|
||||
Reference in New Issue
Block a user