wip
This commit is contained in:
parent
4e9c811868
commit
42cf1110e9
3 changed files with 7 additions and 4 deletions
|
@ -27,7 +27,9 @@ public static class Utils
|
|||
|
||||
public static string GetVisitState(string dtNextVisit)
|
||||
{
|
||||
if (dtNextVisit is "0001-01-01" or "1970-01-01" or "1970-00-00")
|
||||
if (dtNextVisit is "0001-01-01" or "1970-01-01")
|
||||
return "the-draw";
|
||||
if (!DateTime.TryParse(dtNextVisit, out _))
|
||||
return "the-draw";
|
||||
|
||||
var dtNow = DateTime.Now;
|
||||
|
@ -35,6 +37,6 @@ public static class Utils
|
|||
if (dtNow > dtNext)
|
||||
return "the-ugly";
|
||||
|
||||
return (dtNow > dtNext.AddDays(-14)) ? "the-bad" : "the-good";
|
||||
return dtNow > dtNext.AddDays(-14) ? "the-bad" : "the-good";
|
||||
}
|
||||
}
|
|
@ -83,6 +83,8 @@ public partial class CompanyView : IDisposable
|
|||
|
||||
if (!_company.ValidDateSpan())
|
||||
_nextVisit = _lastVisit.AddDays(_company.Interval * 7);
|
||||
_visitState = Utils.GetVisitState($"{_nextVisit:yyyy-MM-dd}");
|
||||
|
||||
if(_company.HasFolded == 1)
|
||||
{
|
||||
_hasFolded = true;
|
||||
|
@ -95,7 +97,6 @@ public partial class CompanyView : IDisposable
|
|||
_company.ValidVat = VatUtils.ValidateFormat(_company.CountryCode, _company.VatNumber) ? 1 : 0;
|
||||
_validVat = _company.ValidVat == 1;
|
||||
_vatState = _company.ValidVat == 1 ? "the-good" : "the-draw";
|
||||
_visitState = Utils.GetVisitState($"{_nextVisit:yyyy-HH-mm}");
|
||||
}
|
||||
_editContext = new EditContext(_company);
|
||||
_editContext.OnFieldChanged += HandleFieldChanged;
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
},
|
||||
"appInfo": {
|
||||
"name": "Wonky Client",
|
||||
"version": "0.8.14",
|
||||
"version": "0.8.15",
|
||||
"isBeta": true,
|
||||
"image": "grumpy-coder.png"
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue