Skip to content

Commit 6997142

Browse files
committed
dateonly
1 parent d767d29 commit 6997142

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

HeroesDemo/src/clientapi/WebApiCoreNG2FormGroupClientAuto.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { FormControl, FormGroup, Validators } from '@angular/forms';
66
function CreateDateOnlyFormControl(){
77
const fc = new FormControl<any | null | undefined>(undefined);
88
fc.valueChanges.subscribe(v=>{
9-
if (v){
9+
if (v && v instanceof Date){
1010
fc.setValue(v.toLocaleDateString("sv").substring(0, 10));
1111
}
1212
});

WebApiClientGenCore.NG2FormGroup/ControllersTsNG2FormGroupClientApiGen.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ protected override void AddBasicReferences()
4343
function CreateDateOnlyFormControl(){
4444
const fc = new FormControl<any | null | undefined>(undefined);
4545
fc.valueChanges.subscribe(v=>{
46-
if (v){
46+
if (v && v instanceof Date){
4747
fc.setValue(v.toLocaleDateString(""sv"").substring(0, 10));
4848
}
4949
});

WebApiClientGenCore.NG2FormGroup/WebApiClientGenCore.NG2FormGroup.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1414
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
1515
<AssemblyName>Fonlow.WebApiClientGenCore.NG2FormGroup</AssemblyName>
16-
<Version>1.9.1</Version>
16+
<Version>1.9.2</Version>
1717
<PackageTags>Angular</PackageTags>
1818
<PackageReadmeFile>README.md</PackageReadmeFile>
1919
<RepositoryUrl>https://github.com/zijianhuang/webapiclientgen</RepositoryUrl>

0 commit comments

Comments
 (0)