mirror of
https://github.com/dlang/tools.git
synced 2025-05-03 00:20:27 +03:00
Add getEndDateTime helper
This commit is contained in:
parent
079d470196
commit
7b48e78165
1 changed files with 22 additions and 0 deletions
22
changed.d
22
changed.d
|
@ -172,6 +172,28 @@ Nullable!DateTime getFirstDateTime(string revRange)
|
||||||
: all.front.nullable;
|
: all.front.nullable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Nullable!DateTime getEndDateTime(string nextVersionDate)
|
||||||
|
{
|
||||||
|
// Input format: "MMM DD, YYYY"
|
||||||
|
if (nextVersionDate.length != 12 ||
|
||||||
|
nextVersionDate[3] != ' ' ||
|
||||||
|
nextVersionDate[6] != ',' || nextVersionDate[7] != ' ')
|
||||||
|
{
|
||||||
|
return Nullable!(DateTime).init;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Converted format: YYYY-MMM-DD
|
||||||
|
string simpleString;
|
||||||
|
simpleString ~= nextVersionDate[8..12];
|
||||||
|
simpleString ~= "-";
|
||||||
|
simpleString ~= nextVersionDate[0..3];
|
||||||
|
simpleString ~= "-";
|
||||||
|
simpleString ~= nextVersionDate[4..6];
|
||||||
|
auto endDate = Date.fromSimpleString(simpleString);
|
||||||
|
|
||||||
|
return DateTime(endDate).nullable;
|
||||||
|
}
|
||||||
|
|
||||||
struct GitIssues
|
struct GitIssues
|
||||||
{
|
{
|
||||||
int[] bugzillaIssueIds;
|
int[] bugzillaIssueIds;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue