commandlineparser / commandlineparser/commandline

DateOnly not supported

Đang mở
#855 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
help wanted
Ngôn ngữ chính
C#
Star
4.8k
Fork
478
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

The `DateOnly` data type causes a `NotSupportedException` to be thrown when calling `ParseArguments`.

v2.9.1 from Nuget.

```
public class CommandLineOptions
{
[Option('v', "verbose", Required = false, HelpText = "Set output to verbose messages.")]
public bool Verbose { get; set; }

[Option('d', "business-date", Required = true, HelpText = "The date (yyyy-mm-dd) to run the process for.")]
public DateTime Works { get; set; }

[Option('e', "run-date", Required = true, HelpText = "The date (yyyy-mm-dd) to run the process for.")]
public DateOnly Fails { get; set; }
}
```

Workaround: Use `DateTime` instead and do an explicit conversion when property is used `DateOnly.FromDateTime(value);`

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.