Fix inconsistent naming in Time

(cherry picked from commit 8409d92282e71f8ad479f48d6b1f6d52eb73ae39)
This commit is contained in:
Nicholas Huelin 2022-04-15 01:09:07 -04:00 committed by Relintai
parent e1be17e581
commit c1010f7d1b
3 changed files with 8 additions and 8 deletions

View File

@ -261,7 +261,7 @@ String Time::get_time_string_from_unix_time(int64_t p_unix_time_val) const {
return vformat("%02d:%02d:%02d", hour, minute, second); return vformat("%02d:%02d:%02d", hour, minute, second);
} }
Dictionary Time::get_datetime_dict_from_string(String p_datetime, bool p_weekday) const { Dictionary Time::get_datetime_dict_from_datetime_string(String p_datetime, bool p_weekday) const {
PARSE_ISO8601_STRING(Dictionary()) PARSE_ISO8601_STRING(Dictionary())
Dictionary dict; Dictionary dict;
dict[YEAR_KEY] = year; dict[YEAR_KEY] = year;
@ -279,7 +279,7 @@ Dictionary Time::get_datetime_dict_from_string(String p_datetime, bool p_weekday
return dict; return dict;
} }
String Time::get_datetime_string_from_dict(const Dictionary p_datetime, bool p_use_space) const { String Time::get_datetime_string_from_datetime_dict(const Dictionary p_datetime, bool p_use_space) const {
ERR_FAIL_COND_V_MSG(p_datetime.empty(), "", "Invalid datetime Dictionary: Dictionary is empty."); ERR_FAIL_COND_V_MSG(p_datetime.empty(), "", "Invalid datetime Dictionary: Dictionary is empty.");
EXTRACT_FROM_DICTIONARY EXTRACT_FROM_DICTIONARY
VALIDATE_YMDHMS("") VALIDATE_YMDHMS("")
@ -410,8 +410,8 @@ void Time::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_datetime_string_from_unix_time", "unix_time_val", "use_space"), &Time::get_datetime_string_from_unix_time, DEFVAL(false)); ClassDB::bind_method(D_METHOD("get_datetime_string_from_unix_time", "unix_time_val", "use_space"), &Time::get_datetime_string_from_unix_time, DEFVAL(false));
ClassDB::bind_method(D_METHOD("get_date_string_from_unix_time", "unix_time_val"), &Time::get_date_string_from_unix_time); ClassDB::bind_method(D_METHOD("get_date_string_from_unix_time", "unix_time_val"), &Time::get_date_string_from_unix_time);
ClassDB::bind_method(D_METHOD("get_time_string_from_unix_time", "unix_time_val"), &Time::get_time_string_from_unix_time); ClassDB::bind_method(D_METHOD("get_time_string_from_unix_time", "unix_time_val"), &Time::get_time_string_from_unix_time);
ClassDB::bind_method(D_METHOD("get_datetime_dict_from_string", "datetime", "weekday"), &Time::get_datetime_dict_from_string); ClassDB::bind_method(D_METHOD("get_datetime_dict_from_datetime_string", "datetime", "weekday"), &Time::get_datetime_dict_from_datetime_string);
ClassDB::bind_method(D_METHOD("get_datetime_string_from_dict", "datetime", "use_space"), &Time::get_datetime_string_from_dict); ClassDB::bind_method(D_METHOD("get_datetime_string_from_datetime_dict", "datetime", "use_space"), &Time::get_datetime_string_from_datetime_dict);
ClassDB::bind_method(D_METHOD("get_unix_time_from_datetime_dict", "datetime"), &Time::get_unix_time_from_datetime_dict); ClassDB::bind_method(D_METHOD("get_unix_time_from_datetime_dict", "datetime"), &Time::get_unix_time_from_datetime_dict);
ClassDB::bind_method(D_METHOD("get_unix_time_from_datetime_string", "datetime"), &Time::get_unix_time_from_datetime_string); ClassDB::bind_method(D_METHOD("get_unix_time_from_datetime_string", "datetime"), &Time::get_unix_time_from_datetime_string);
ClassDB::bind_method(D_METHOD("get_offset_string_from_offset_minutes", "offset_minutes"), &Time::get_offset_string_from_offset_minutes); ClassDB::bind_method(D_METHOD("get_offset_string_from_offset_minutes", "offset_minutes"), &Time::get_offset_string_from_offset_minutes);

View File

@ -84,8 +84,8 @@ public:
String get_datetime_string_from_unix_time(int64_t p_unix_time_val, bool p_use_space = false) const; String get_datetime_string_from_unix_time(int64_t p_unix_time_val, bool p_use_space = false) const;
String get_date_string_from_unix_time(int64_t p_unix_time_val) const; String get_date_string_from_unix_time(int64_t p_unix_time_val) const;
String get_time_string_from_unix_time(int64_t p_unix_time_val) const; String get_time_string_from_unix_time(int64_t p_unix_time_val) const;
Dictionary get_datetime_dict_from_string(String p_datetime, bool p_weekday = true) const; Dictionary get_datetime_dict_from_datetime_string(String p_datetime, bool p_weekday = true) const;
String get_datetime_string_from_dict(const Dictionary p_datetime, bool p_use_space = false) const; String get_datetime_string_from_datetime_dict(const Dictionary p_datetime, bool p_use_space = false) const;
int64_t get_unix_time_from_datetime_dict(const Dictionary p_datetime) const; int64_t get_unix_time_from_datetime_dict(const Dictionary p_datetime) const;
int64_t get_unix_time_from_datetime_string(String p_datetime) const; int64_t get_unix_time_from_datetime_string(String p_datetime) const;
String get_offset_string_from_offset_minutes(int64_t p_offset_minutes) const; String get_offset_string_from_offset_minutes(int64_t p_offset_minutes) const;

View File

@ -43,7 +43,7 @@
Converts the given Unix timestamp to an ISO 8601 date string (YYYY-MM-DD). Converts the given Unix timestamp to an ISO 8601 date string (YYYY-MM-DD).
</description> </description>
</method> </method>
<method name="get_datetime_dict_from_string" qualifiers="const"> <method name="get_datetime_dict_from_datetime_string" qualifiers="const">
<return type="Dictionary" /> <return type="Dictionary" />
<argument index="0" name="datetime" type="String" /> <argument index="0" name="datetime" type="String" />
<argument index="1" name="weekday" type="bool" /> <argument index="1" name="weekday" type="bool" />
@ -68,7 +68,7 @@
The returned Dictionary's values will be the same as the [method get_datetime_dict_from_system] if the Unix timestamp is the current time, with the exception of Daylight Savings Time as it cannot be determined from the epoch. The returned Dictionary's values will be the same as the [method get_datetime_dict_from_system] if the Unix timestamp is the current time, with the exception of Daylight Savings Time as it cannot be determined from the epoch.
</description> </description>
</method> </method>
<method name="get_datetime_string_from_dict" qualifiers="const"> <method name="get_datetime_string_from_datetime_dict" qualifiers="const">
<return type="String" /> <return type="String" />
<argument index="0" name="datetime" type="Dictionary" /> <argument index="0" name="datetime" type="Dictionary" />
<argument index="1" name="use_space" type="bool" /> <argument index="1" name="use_space" type="bool" />