[Design document] Issue 397: Random Date/Time Only #398
Replies: 3 comments 3 replies
-
I received a comment from @bchavez , adding to this thread. |
Beta Was this translation helpful? Give feedback.
-
Hi @bchavez and @rgarrison12345, I wrote code for all methods mentioned by @bchavez in his comment #397 except two. Could you please help me with some hints/input regarding the implementation of the below methods?
Thanks, |
Beta Was this translation helpful? Give feedback.
-
Hi @bchavez, Thanks for the suggestion, I implemented Note: As this changes required introduction of new TargetFramework i.e. .NET60. PR build is failing for the latest target framework. FYI @rgarrison12345 |
Beta Was this translation helpful? Give feedback.
-
This is regarding adding a new feature to support DateOnly and TimeOnly structs to C# Bogus repository.
Before I start working on this issue, I have an approach to solve this issue. I would like to discuss it with you all.
Here is the rough design document for the above approach.
Add new functions In Date class:
Project: Bogus
Class Name: Date
Implementation:
The following table shows methods that will follow a similar logic to support
DateOnly
andTimeOnly
.I added two columns that describe the return type of that method.
If you are agreeing with this approach, then I will include all methods mentioned in the above table will raise PR soon.
Advantages of this implementation:
Question:
Should we keep the same name of functions and change just return time?
e.g
public DateTime Past(int yearsToGoBack = 1, DateOnly? refDateOnly = null){...} //For DateTime
Another approach:
Advantages of this implementation:
Questions:
Looking forward to hearing from you.
Thanks and Regards,
Prasad
FYI @bchavez, @rgarrison12345
Beta Was this translation helpful? Give feedback.
All reactions