Skip to content

Commit

Permalink
Fixed typo in docs + minor date time addition
Browse files Browse the repository at this point in the history
  • Loading branch information
hosseinmoein committed Jun 19, 2024
1 parent 4ffae2c commit 2654c9a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/HTML/DateTime.html
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ <H2><font color="blue">Member Functions</font></H2>
<span class="line_wrapper"> <span style="color:#696969; ">//</span></span>
<span class="line_wrapper"> <span style="color:#800000; font-weight:bold; ">explicit</span></span>
<span class="line_wrapper"> DateTime<span style="color:#808030; ">(</span>DateType d<span style="color:#808030; ">,</span> <span style="color:#696969; ">// Date e.g. 20180112</span></span>
<span class="line_wrapper"> HourType hr <span style="color:#808030; ">=</span> <span style="color:#008c00; ">0</span><span style="color:#808030; ">,</span> Hour e<span style="color:#808030; ">.</span>g<span style="color:#808030; ">.</span> <span style="color:#008c00; ">13</span></span>
<span class="line_wrapper"> HourType hr <span style="color:#808030; ">=</span> <span style="color:#008c00; ">0</span><span style="color:#808030; ">,</span> <span style="color:#696969; ">// Hour e.g. 13</span></span>
<span class="line_wrapper"> MinuteType mn <span style="color:#808030; ">=</span> <span style="color:#008c00; ">0</span><span style="color:#808030; ">,</span> <span style="color:#696969; ">// Minute e.g. 45</span></span>
<span class="line_wrapper"> SecondType sc <span style="color:#808030; ">=</span> <span style="color:#008c00; ">0</span><span style="color:#808030; ">,</span> <span style="color:#696969; ">// Second e.g. 45</span></span>
<span class="line_wrapper"> NanosecondType ns <span style="color:#808030; ">=</span> <span style="color:#008c00; ">0</span><span style="color:#808030; ">,</span> <span style="color:#696969; ">// Nano-second e.g. 123456789</span></span>
Expand Down
6 changes: 4 additions & 2 deletions src/Utils/DateTime.cc
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ DateTime::DateTime (const char *s, DT_DATE_STYLE ds, DT_TIME_ZONE tz)
const bool has_str_tz =
std::isalpha(str[str_len - 1]) &&
std::isalpha(str[str_len - 2]) &&
std::isalpha(str[str_len - 3]);
std::isalpha(str[str_len - 3]) &&
std::isspace(str[str_len - 4]);
char str_tz[4];

if (has_str_tz) {
Expand Down Expand Up @@ -370,7 +371,8 @@ DateTime &DateTime::operator = (const char *s) {
const bool has_str_tz =
std::isalpha(str[str_len - 1]) &&
std::isalpha(str[str_len - 2]) &&
std::isalpha(str[str_len - 3]);
std::isalpha(str[str_len - 3]) &&
std::isspace(str[str_len - 4]);
char str_tz[4];

if (has_str_tz) {
Expand Down

0 comments on commit 2654c9a

Please sign in to comment.