forked from loafle/openapi-generator-original
support formatting date only (#19785)
This commit is contained in:
parent
c8fad42324
commit
fce8bb9604
@ -172,6 +172,10 @@ using System.Runtime.CompilerServices;
|
||||
// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8
|
||||
// For example: 2009-06-15T13:45:30.0000000
|
||||
return dateTimeOffset.ToString(format);
|
||||
{{#net60OrLater}}
|
||||
if (obj is DateOnly dateOnly)
|
||||
return dateOnly.ToString(format);
|
||||
{{/net60OrLater}}
|
||||
if (obj is bool boolean)
|
||||
return boolean
|
||||
? "true"
|
||||
|
@ -131,6 +131,8 @@ namespace Org.OpenAPITools.Client
|
||||
// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8
|
||||
// For example: 2009-06-15T13:45:30.0000000
|
||||
return dateTimeOffset.ToString(format);
|
||||
if (obj is DateOnly dateOnly)
|
||||
return dateOnly.ToString(format);
|
||||
if (obj is bool boolean)
|
||||
return boolean
|
||||
? "true"
|
||||
|
@ -131,6 +131,8 @@ namespace Org.OpenAPITools.Client
|
||||
// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8
|
||||
// For example: 2009-06-15T13:45:30.0000000
|
||||
return dateTimeOffset.ToString(format);
|
||||
if (obj is DateOnly dateOnly)
|
||||
return dateOnly.ToString(format);
|
||||
if (obj is bool boolean)
|
||||
return boolean
|
||||
? "true"
|
||||
|
@ -116,6 +116,8 @@ namespace Org.OpenAPITools.Client
|
||||
// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8
|
||||
// For example: 2009-06-15T13:45:30.0000000
|
||||
return dateTimeOffset.ToString(format);
|
||||
if (obj is DateOnly dateOnly)
|
||||
return dateOnly.ToString(format);
|
||||
if (obj is bool boolean)
|
||||
return boolean
|
||||
? "true"
|
||||
|
@ -160,6 +160,8 @@ namespace Org.OpenAPITools.Client
|
||||
// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8
|
||||
// For example: 2009-06-15T13:45:30.0000000
|
||||
return dateTimeOffset.ToString(format);
|
||||
if (obj is DateOnly dateOnly)
|
||||
return dateOnly.ToString(format);
|
||||
if (obj is bool boolean)
|
||||
return boolean
|
||||
? "true"
|
||||
|
@ -162,6 +162,8 @@ namespace Org.OpenAPITools.Client
|
||||
// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8
|
||||
// For example: 2009-06-15T13:45:30.0000000
|
||||
return dateTimeOffset.ToString(format);
|
||||
if (obj is DateOnly dateOnly)
|
||||
return dateOnly.ToString(format);
|
||||
if (obj is bool boolean)
|
||||
return boolean
|
||||
? "true"
|
||||
|
@ -131,6 +131,8 @@ namespace Org.OpenAPITools.Client
|
||||
// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8
|
||||
// For example: 2009-06-15T13:45:30.0000000
|
||||
return dateTimeOffset.ToString(format);
|
||||
if (obj is DateOnly dateOnly)
|
||||
return dateOnly.ToString(format);
|
||||
if (obj is bool boolean)
|
||||
return boolean
|
||||
? "true"
|
||||
|
@ -160,6 +160,8 @@ namespace Org.OpenAPITools.Client
|
||||
// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8
|
||||
// For example: 2009-06-15T13:45:30.0000000
|
||||
return dateTimeOffset.ToString(format);
|
||||
if (obj is DateOnly dateOnly)
|
||||
return dateOnly.ToString(format);
|
||||
if (obj is bool boolean)
|
||||
return boolean
|
||||
? "true"
|
||||
|
@ -162,6 +162,8 @@ namespace Org.OpenAPITools.Client
|
||||
// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8
|
||||
// For example: 2009-06-15T13:45:30.0000000
|
||||
return dateTimeOffset.ToString(format);
|
||||
if (obj is DateOnly dateOnly)
|
||||
return dateOnly.ToString(format);
|
||||
if (obj is bool boolean)
|
||||
return boolean
|
||||
? "true"
|
||||
|
@ -116,6 +116,8 @@ namespace Org.OpenAPITools.Client
|
||||
// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8
|
||||
// For example: 2009-06-15T13:45:30.0000000
|
||||
return dateTimeOffset.ToString(format);
|
||||
if (obj is DateOnly dateOnly)
|
||||
return dateOnly.ToString(format);
|
||||
if (obj is bool boolean)
|
||||
return boolean
|
||||
? "true"
|
||||
|
Loading…
x
Reference in New Issue
Block a user