| 
									
										
										
										
											2021-08-01 17:20:11 +01:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright (c) 2021, Linus Groh <linusg@serenityos.org> | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <LibJS/Runtime/BigInt.h>
 | 
					
						
							|  |  |  | #include <LibJS/Runtime/Object.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace JS::Temporal { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class ZonedDateTime final : public Object { | 
					
						
							|  |  |  |     JS_OBJECT(ZonedDateTime, Object); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							| 
									
										
										
										
											2021-09-09 21:18:08 +01:00
										 |  |  |     ZonedDateTime(BigInt const& nanoseconds, Object& time_zone, Object& calendar, Object& prototype); | 
					
						
							| 
									
										
										
										
											2021-08-01 17:20:11 +01:00
										 |  |  |     virtual ~ZonedDateTime() override = default; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-07 21:50:35 +01:00
										 |  |  |     [[nodiscard]] BigInt const& nanoseconds() const { return m_nanoseconds; } | 
					
						
							|  |  |  |     [[nodiscard]] Object const& time_zone() const { return m_time_zone; } | 
					
						
							|  |  |  |     [[nodiscard]] Object& time_zone() { return m_time_zone; } | 
					
						
							|  |  |  |     [[nodiscard]] Object const& calendar() const { return m_calendar; } | 
					
						
							|  |  |  |     [[nodiscard]] Object& calendar() { return m_calendar; } | 
					
						
							| 
									
										
										
										
											2021-08-01 17:20:11 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  |     virtual void visit_edges(Visitor&) override; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // 6.4 Properties of Temporal.ZonedDateTime Instances, https://tc39.es/proposal-temporal/#sec-properties-of-temporal-zoneddatetime-instances
 | 
					
						
							| 
									
										
										
										
											2021-09-09 21:18:08 +01:00
										 |  |  |     BigInt const& m_nanoseconds; // [[Nanoseconds]]
 | 
					
						
							|  |  |  |     Object& m_time_zone;         // [[TimeZone]]
 | 
					
						
							|  |  |  |     Object& m_calendar;          // [[Calendar]]
 | 
					
						
							| 
									
										
										
										
											2021-08-01 17:20:11 +01:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-16 00:59:40 +03:00
										 |  |  | ThrowCompletionOr<ZonedDateTime*> create_temporal_zoned_date_time(GlobalObject&, BigInt const& epoch_nanoseconds, Object& time_zone, Object& calendar, FunctionObject const* new_target = nullptr); | 
					
						
							| 
									
										
										
										
											2021-08-01 17:20:11 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | } |