mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-29 13:46:31 +00:00
LibJS: Add Date methods: setHours, setMinutes, setSeconds, setMilliseconds
This commit is contained in:
parent
974a981ded
commit
43f0c92bcd
Notes:
sideshowbarker
2024-07-18 21:13:34 +09:00
Author: https://github.com/tuqqu
Commit: 43f0c92bcd
Pull-request: https://github.com/SerenityOS/serenity/pull/5873
Reviewed-by: https://github.com/linusg ✅
8 changed files with 190 additions and 1 deletions
|
@ -63,6 +63,11 @@ public:
|
|||
int utc_month() const;
|
||||
int utc_seconds() const;
|
||||
|
||||
void set_milliseconds(u16 milliseconds)
|
||||
{
|
||||
m_milliseconds = milliseconds;
|
||||
}
|
||||
|
||||
String date_string() const { return m_datetime.to_string("%a %b %d %Y"); }
|
||||
// FIXME: Deal with timezones once SerenityOS has a working tzset(3)
|
||||
String time_string() const { return m_datetime.to_string("%T GMT+0000 (UTC)"); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue