@rvoh/dream 2.2.3 → 2.3.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (298) hide show
  1. package/dist/cjs/src/Dream.js +5 -5
  2. package/dist/cjs/src/db/dataTypes.js +1 -0
  3. package/dist/cjs/src/db/index.js +2 -2
  4. package/dist/cjs/src/dream/QueryDriver/Base.js +2 -2
  5. package/dist/cjs/src/dream/QueryDriver/Kysely.js +2 -2
  6. package/dist/cjs/src/dream/QueryDriver/helpers/kysely/checkForNeedToBeRunMigrations.js +2 -2
  7. package/dist/cjs/src/dream/QueryDriver/helpers/kysely/migrationFolderPath.js +6 -1
  8. package/dist/cjs/src/dream/QueryDriver/helpers/kysely/runMigration.js +2 -2
  9. package/dist/cjs/src/dream/internal/saveDream.js +1 -1
  10. package/dist/cjs/src/dream/internal/softDeleteDream.js +1 -1
  11. package/dist/cjs/src/dream-app/helpers/globalModelKeyFromPath.js +5 -2
  12. package/dist/cjs/src/dream-app/helpers/globalSerializerKeyFromPath.js +5 -2
  13. package/dist/cjs/src/dream-app/helpers/normalizeFilePath.js +3 -0
  14. package/dist/cjs/src/dream-app/index.js +3 -3
  15. package/dist/cjs/src/helpers/areEqual.js +2 -2
  16. package/dist/cjs/src/helpers/cli/ASTBuilder.js +2 -2
  17. package/dist/cjs/src/helpers/cloneDeepSafe.js +2 -2
  18. package/dist/cjs/src/helpers/customPgParsers.js +2 -2
  19. package/dist/cjs/src/helpers/loadRepl.js +2 -2
  20. package/dist/cjs/src/helpers/path/PathHelpers.js +27 -0
  21. package/dist/cjs/src/helpers/path/convertToFileURL.js +7 -0
  22. package/dist/cjs/src/helpers/path/windowsSafePath.js +22 -0
  23. package/dist/cjs/src/helpers/sortBy.js +2 -2
  24. package/dist/cjs/src/helpers/sqlAttributes.js +2 -2
  25. package/dist/cjs/src/helpers/stringCasing.js +2 -2
  26. package/dist/cjs/src/package-exports/errors.js +2 -1
  27. package/dist/cjs/src/package-exports/index.js +2 -2
  28. package/dist/cjs/src/package-exports/system.js +1 -0
  29. package/dist/cjs/src/serializer/SerializerRenderer.js +2 -2
  30. package/dist/cjs/src/types/calendardate.js +1 -0
  31. package/dist/cjs/src/types/datetime.js +1 -0
  32. package/dist/cjs/src/utils/datetime/CalendarDate.js +489 -0
  33. package/dist/cjs/src/utils/datetime/DateTime.js +1140 -0
  34. package/dist/cjs/src/utils/datetime/helpers/isoTimeDecimalString.js +8 -0
  35. package/dist/cjs/src/utils/datetime/helpers/microsecondParts.js +16 -0
  36. package/dist/cjs/src/utils/datetime/helpers/replaceISOMicroseconds.js +10 -0
  37. package/dist/esm/src/Dream.js +5 -5
  38. package/dist/esm/src/db/dataTypes.js +1 -0
  39. package/dist/esm/src/db/index.js +2 -2
  40. package/dist/esm/src/dream/QueryDriver/Base.js +2 -2
  41. package/dist/esm/src/dream/QueryDriver/Kysely.js +2 -2
  42. package/dist/esm/src/dream/QueryDriver/helpers/kysely/checkForNeedToBeRunMigrations.js +2 -2
  43. package/dist/esm/src/dream/QueryDriver/helpers/kysely/migrationFolderPath.js +6 -1
  44. package/dist/esm/src/dream/QueryDriver/helpers/kysely/runMigration.js +2 -2
  45. package/dist/esm/src/dream/internal/saveDream.js +1 -1
  46. package/dist/esm/src/dream/internal/softDeleteDream.js +1 -1
  47. package/dist/esm/src/dream-app/helpers/globalModelKeyFromPath.js +5 -2
  48. package/dist/esm/src/dream-app/helpers/globalSerializerKeyFromPath.js +5 -2
  49. package/dist/esm/src/dream-app/helpers/normalizeFilePath.js +3 -0
  50. package/dist/esm/src/dream-app/index.js +3 -3
  51. package/dist/esm/src/helpers/areEqual.js +2 -2
  52. package/dist/esm/src/helpers/cli/ASTBuilder.js +2 -2
  53. package/dist/esm/src/helpers/cloneDeepSafe.js +2 -2
  54. package/dist/esm/src/helpers/customPgParsers.js +2 -2
  55. package/dist/esm/src/helpers/loadRepl.js +2 -2
  56. package/dist/esm/src/helpers/path/PathHelpers.js +27 -0
  57. package/dist/esm/src/helpers/path/convertToFileURL.js +7 -0
  58. package/dist/esm/src/helpers/path/windowsSafePath.js +22 -0
  59. package/dist/esm/src/helpers/sortBy.js +2 -2
  60. package/dist/esm/src/helpers/sqlAttributes.js +2 -2
  61. package/dist/esm/src/helpers/stringCasing.js +2 -2
  62. package/dist/esm/src/package-exports/errors.js +2 -1
  63. package/dist/esm/src/package-exports/index.js +2 -2
  64. package/dist/esm/src/package-exports/system.js +1 -0
  65. package/dist/esm/src/serializer/SerializerRenderer.js +2 -2
  66. package/dist/esm/src/types/calendardate.js +1 -0
  67. package/dist/esm/src/types/datetime.js +1 -0
  68. package/dist/esm/src/utils/datetime/CalendarDate.js +489 -0
  69. package/dist/esm/src/utils/datetime/DateTime.js +1140 -0
  70. package/dist/esm/src/utils/datetime/helpers/isoTimeDecimalString.js +8 -0
  71. package/dist/esm/src/utils/datetime/helpers/microsecondParts.js +16 -0
  72. package/dist/esm/src/utils/datetime/helpers/replaceISOMicroseconds.js +10 -0
  73. package/dist/types/src/Dream.d.ts +1 -1
  74. package/dist/types/src/db/dataTypes.d.ts +2 -2
  75. package/dist/types/src/dream-app/helpers/normalizeFilePath.d.ts +1 -0
  76. package/dist/types/src/helpers/customPgParsers.d.ts +3 -2
  77. package/dist/types/src/helpers/path/PathHelpers.d.ts +21 -0
  78. package/dist/types/src/helpers/path/convertToFileURL.d.ts +1 -0
  79. package/dist/types/src/helpers/path/windowsSafePath.d.ts +20 -0
  80. package/dist/types/src/helpers/range.d.ts +2 -2
  81. package/dist/types/src/helpers/sort.d.ts +2 -2
  82. package/dist/types/src/helpers/sortBy.d.ts +2 -2
  83. package/dist/types/src/package-exports/errors.d.ts +2 -1
  84. package/dist/types/src/package-exports/index.d.ts +2 -2
  85. package/dist/types/src/package-exports/system.d.ts +1 -0
  86. package/dist/types/src/package-exports/types.d.ts +2 -0
  87. package/dist/types/src/types/associations/shared.d.ts +2 -2
  88. package/dist/types/src/types/associations/shared.ts +2 -2
  89. package/dist/types/src/types/calendardate.d.ts +4 -0
  90. package/dist/types/src/types/calendardate.ts +8 -0
  91. package/dist/types/src/types/datetime.d.ts +102 -0
  92. package/dist/types/src/types/datetime.ts +141 -0
  93. package/dist/types/src/types/dream.d.ts +2 -2
  94. package/dist/types/src/types/dream.ts +2 -2
  95. package/dist/types/src/types/moduleDeclarations/luxon.d.ts +5 -6
  96. package/dist/types/src/utils/datetime/CalendarDate.d.ts +375 -0
  97. package/dist/types/src/utils/datetime/DateTime.d.ts +773 -0
  98. package/dist/types/src/utils/datetime/helpers/isoTimeDecimalString.d.ts +4 -0
  99. package/dist/types/src/utils/datetime/helpers/microsecondParts.d.ts +10 -0
  100. package/dist/types/src/utils/datetime/helpers/replaceISOMicroseconds.d.ts +3 -0
  101. package/docs/assets/highlight.css +7 -0
  102. package/docs/assets/navigation.js +1 -1
  103. package/docs/assets/search.js +1 -1
  104. package/docs/classes/db.DreamMigrationHelpers.html +9 -9
  105. package/docs/classes/db.KyselyQueryDriver.html +33 -33
  106. package/docs/classes/db.PostgresQueryDriver.html +34 -34
  107. package/docs/classes/db.QueryDriverBase.html +32 -32
  108. package/docs/classes/errors.CheckConstraintViolation.html +3 -3
  109. package/docs/classes/errors.ColumnOverflow.html +3 -3
  110. package/docs/classes/errors.CreateOrFindByFailedToCreateAndFind.html +3 -3
  111. package/docs/classes/errors.DataIncompatibleWithDatabaseField.html +3 -3
  112. package/docs/classes/errors.DataTypeColumnTypeMismatch.html +3 -3
  113. package/docs/classes/errors.GlobalNameNotSet.html +3 -3
  114. package/docs/classes/errors.InvalidCalendarDate.html +7 -2
  115. package/docs/classes/errors.InvalidDateTime.html +17 -0
  116. package/docs/classes/errors.MissingSerializersDefinition.html +3 -3
  117. package/docs/classes/errors.NonLoadedAssociation.html +3 -3
  118. package/docs/classes/errors.NotNullViolation.html +3 -3
  119. package/docs/classes/errors.RecordNotFound.html +3 -3
  120. package/docs/classes/errors.ValidationError.html +3 -3
  121. package/docs/classes/index.CalendarDate.html +195 -2
  122. package/docs/classes/index.DateTime.html +485 -0
  123. package/docs/classes/index.Decorators.html +19 -19
  124. package/docs/classes/index.Dream.html +121 -121
  125. package/docs/classes/index.DreamApp.html +5 -5
  126. package/docs/classes/index.DreamTransaction.html +2 -2
  127. package/docs/classes/index.Env.html +2 -2
  128. package/docs/classes/index.Query.html +59 -59
  129. package/docs/classes/system.CliFileWriter.html +2 -2
  130. package/docs/classes/system.DreamBin.html +2 -2
  131. package/docs/classes/system.DreamCLI.html +5 -5
  132. package/docs/classes/system.DreamImporter.html +2 -2
  133. package/docs/classes/system.DreamLogos.html +2 -2
  134. package/docs/classes/system.DreamSerializerBuilder.html +8 -8
  135. package/docs/classes/system.ObjectSerializerBuilder.html +8 -8
  136. package/docs/classes/system.PathHelpers.html +13 -0
  137. package/docs/classes/utils.Encrypt.html +2 -2
  138. package/docs/classes/utils.Range.html +2 -2
  139. package/docs/functions/db.closeAllDbConnections.html +1 -1
  140. package/docs/functions/db.dreamDbConnections.html +1 -1
  141. package/docs/functions/db.untypedDb.html +1 -1
  142. package/docs/functions/db.validateColumn.html +1 -1
  143. package/docs/functions/db.validateTable.html +1 -1
  144. package/docs/functions/errors.pgErrorType.html +1 -1
  145. package/docs/functions/index.DreamSerializer.html +1 -1
  146. package/docs/functions/index.ObjectSerializer.html +1 -1
  147. package/docs/functions/index.ReplicaSafe.html +1 -1
  148. package/docs/functions/index.STI.html +1 -1
  149. package/docs/functions/index.SoftDelete.html +1 -1
  150. package/docs/functions/utils.camelize.html +1 -1
  151. package/docs/functions/utils.capitalize.html +1 -1
  152. package/docs/functions/utils.cloneDeepSafe.html +1 -1
  153. package/docs/functions/utils.compact.html +2 -2
  154. package/docs/functions/utils.groupBy.html +1 -1
  155. package/docs/functions/utils.hyphenize.html +1 -1
  156. package/docs/functions/utils.intersection.html +1 -1
  157. package/docs/functions/utils.isEmpty.html +1 -1
  158. package/docs/functions/utils.normalizeUnicode.html +1 -1
  159. package/docs/functions/utils.pascalize.html +1 -1
  160. package/docs/functions/utils.percent.html +1 -1
  161. package/docs/functions/utils.range-1.html +1 -1
  162. package/docs/functions/utils.round.html +1 -1
  163. package/docs/functions/utils.sanitizeString.html +1 -1
  164. package/docs/functions/utils.snakeify.html +1 -1
  165. package/docs/functions/utils.sort.html +1 -1
  166. package/docs/functions/utils.sortBy.html +1 -1
  167. package/docs/functions/utils.sortObjectByKey.html +1 -1
  168. package/docs/functions/utils.sortObjectByValue.html +1 -1
  169. package/docs/functions/utils.uncapitalize.html +1 -1
  170. package/docs/functions/utils.uniq.html +1 -1
  171. package/docs/interfaces/openapi.OpenapiDescription.html +2 -2
  172. package/docs/interfaces/openapi.OpenapiSchemaProperties.html +1 -1
  173. package/docs/interfaces/openapi.OpenapiSchemaPropertiesShorthand.html +1 -1
  174. package/docs/interfaces/openapi.OpenapiTypeFieldObject.html +1 -1
  175. package/docs/interfaces/types.BelongsToStatement.html +2 -2
  176. package/docs/interfaces/types.DecoratorContext.html +2 -2
  177. package/docs/interfaces/types.DreamAppInitOptions.html +2 -2
  178. package/docs/interfaces/types.DreamAppOpts.html +2 -2
  179. package/docs/interfaces/types.DurationObject.html +12 -0
  180. package/docs/interfaces/types.EncryptOptions.html +2 -2
  181. package/docs/interfaces/types.InternalAnyTypedSerializerRendersMany.html +2 -2
  182. package/docs/interfaces/types.InternalAnyTypedSerializerRendersOne.html +2 -2
  183. package/docs/interfaces/types.SerializerRendererOpts.html +2 -2
  184. package/docs/modules/db.html +1 -1
  185. package/docs/modules/errors.html +2 -1
  186. package/docs/modules/index.html +3 -4
  187. package/docs/modules/openapi.html +1 -1
  188. package/docs/modules/system.html +2 -1
  189. package/docs/modules/types.html +6 -2
  190. package/docs/modules/utils.html +1 -1
  191. package/docs/types/openapi.CommonOpenapiSchemaObjectFields.html +1 -1
  192. package/docs/types/openapi.OpenapiAllTypes.html +1 -1
  193. package/docs/types/openapi.OpenapiFormats.html +1 -1
  194. package/docs/types/openapi.OpenapiNumberFormats.html +1 -1
  195. package/docs/types/openapi.OpenapiPrimitiveBaseTypes.html +1 -1
  196. package/docs/types/openapi.OpenapiPrimitiveTypes.html +1 -1
  197. package/docs/types/openapi.OpenapiSchemaArray.html +1 -1
  198. package/docs/types/openapi.OpenapiSchemaArrayShorthand.html +1 -1
  199. package/docs/types/openapi.OpenapiSchemaBase.html +1 -1
  200. package/docs/types/openapi.OpenapiSchemaBody.html +1 -1
  201. package/docs/types/openapi.OpenapiSchemaBodyShorthand.html +1 -1
  202. package/docs/types/openapi.OpenapiSchemaCommonFields.html +1 -1
  203. package/docs/types/openapi.OpenapiSchemaExpressionAllOf.html +1 -1
  204. package/docs/types/openapi.OpenapiSchemaExpressionAnyOf.html +1 -1
  205. package/docs/types/openapi.OpenapiSchemaExpressionOneOf.html +1 -1
  206. package/docs/types/openapi.OpenapiSchemaExpressionRef.html +1 -1
  207. package/docs/types/openapi.OpenapiSchemaExpressionRefSchemaShorthand.html +1 -1
  208. package/docs/types/openapi.OpenapiSchemaInteger.html +1 -1
  209. package/docs/types/openapi.OpenapiSchemaNull.html +1 -1
  210. package/docs/types/openapi.OpenapiSchemaNumber.html +1 -1
  211. package/docs/types/openapi.OpenapiSchemaObject.html +1 -1
  212. package/docs/types/openapi.OpenapiSchemaObjectAllOf.html +1 -1
  213. package/docs/types/openapi.OpenapiSchemaObjectAllOfShorthand.html +1 -1
  214. package/docs/types/openapi.OpenapiSchemaObjectAnyOf.html +1 -1
  215. package/docs/types/openapi.OpenapiSchemaObjectAnyOfShorthand.html +1 -1
  216. package/docs/types/openapi.OpenapiSchemaObjectBase.html +1 -1
  217. package/docs/types/openapi.OpenapiSchemaObjectBaseShorthand.html +1 -1
  218. package/docs/types/openapi.OpenapiSchemaObjectOneOf.html +1 -1
  219. package/docs/types/openapi.OpenapiSchemaObjectOneOfShorthand.html +1 -1
  220. package/docs/types/openapi.OpenapiSchemaObjectShorthand.html +1 -1
  221. package/docs/types/openapi.OpenapiSchemaPrimitiveGeneric.html +1 -1
  222. package/docs/types/openapi.OpenapiSchemaShorthandExpressionAllOf.html +1 -1
  223. package/docs/types/openapi.OpenapiSchemaShorthandExpressionAnyOf.html +1 -1
  224. package/docs/types/openapi.OpenapiSchemaShorthandExpressionOneOf.html +1 -1
  225. package/docs/types/openapi.OpenapiSchemaShorthandExpressionSerializableRef.html +1 -1
  226. package/docs/types/openapi.OpenapiSchemaShorthandExpressionSerializerRef.html +1 -1
  227. package/docs/types/openapi.OpenapiSchemaShorthandPrimitiveGeneric.html +1 -1
  228. package/docs/types/openapi.OpenapiSchemaString.html +1 -1
  229. package/docs/types/openapi.OpenapiShorthandAllTypes.html +1 -1
  230. package/docs/types/openapi.OpenapiShorthandPrimitiveBaseTypes.html +1 -1
  231. package/docs/types/openapi.OpenapiShorthandPrimitiveTypes.html +1 -1
  232. package/docs/types/openapi.OpenapiTypeField.html +1 -1
  233. package/docs/types/system.DreamAppAllowedPackageManagersEnum.html +1 -1
  234. package/docs/types/types.CalendarDateDurationUnit.html +1 -0
  235. package/docs/types/types.Camelized.html +1 -1
  236. package/docs/types/types.DbConnectionType.html +1 -1
  237. package/docs/types/types.DbTypes.html +1 -1
  238. package/docs/types/types.DreamAssociationMetadata.html +1 -1
  239. package/docs/types/types.DreamAttributes.html +1 -1
  240. package/docs/types/types.DreamClassAssociationAndStatement.html +1 -1
  241. package/docs/types/types.DreamClassColumn.html +1 -1
  242. package/docs/types/types.DreamColumn.html +1 -1
  243. package/docs/types/types.DreamColumnNames.html +1 -1
  244. package/docs/types/types.DreamLogLevel.html +1 -1
  245. package/docs/types/types.DreamLogger.html +1 -1
  246. package/docs/types/types.DreamModelSerializerType.html +1 -1
  247. package/docs/types/types.DreamOrViewModelClassSerializerKey.html +1 -1
  248. package/docs/types/types.DreamOrViewModelSerializerKey.html +1 -1
  249. package/docs/types/types.DreamParamSafeAttributes.html +1 -1
  250. package/docs/types/types.DreamParamSafeColumnNames.html +1 -1
  251. package/docs/types/types.DreamSerializable.html +1 -1
  252. package/docs/types/types.DreamSerializableArray.html +1 -1
  253. package/docs/types/types.DreamSerializerKey.html +1 -1
  254. package/docs/types/types.DreamSerializers.html +1 -1
  255. package/docs/types/types.DreamVirtualColumns.html +1 -1
  256. package/docs/types/types.DurationUnit.html +4 -0
  257. package/docs/types/types.EncryptAlgorithm.html +1 -1
  258. package/docs/types/types.HasManyStatement.html +1 -1
  259. package/docs/types/types.HasOneStatement.html +1 -1
  260. package/docs/types/types.Hyphenized.html +1 -1
  261. package/docs/types/types.Pascalized.html +1 -1
  262. package/docs/types/types.PrimaryKeyType.html +1 -1
  263. package/docs/types/types.RoundingPrecision.html +1 -1
  264. package/docs/types/types.SerializerCasing.html +1 -1
  265. package/docs/types/types.SimpleObjectSerializerType.html +1 -1
  266. package/docs/types/types.Snakeified.html +1 -1
  267. package/docs/types/types.StrictInterface.html +1 -1
  268. package/docs/types/types.UpdateableAssociationProperties.html +1 -1
  269. package/docs/types/types.UpdateableProperties.html +1 -1
  270. package/docs/types/types.ValidationType.html +1 -1
  271. package/docs/types/types.ViewModel.html +1 -1
  272. package/docs/types/types.ViewModelClass.html +1 -1
  273. package/docs/types/types.WeekdayName.html +2 -0
  274. package/docs/types/types.WhereStatementForDream.html +1 -1
  275. package/docs/types/types.WhereStatementForDreamClass.html +1 -1
  276. package/docs/variables/index.DreamConst.html +1 -1
  277. package/docs/variables/index.ops.html +1 -1
  278. package/docs/variables/openapi.openapiPrimitiveTypes-1.html +1 -1
  279. package/docs/variables/openapi.openapiShorthandPrimitiveTypes-1.html +1 -1
  280. package/docs/variables/system.DreamAppAllowedPackageManagersEnumValues.html +1 -1
  281. package/docs/variables/system.primaryKeyTypes.html +1 -1
  282. package/package.json +3 -2
  283. package/dist/cjs/src/helpers/CalendarDate.js +0 -151
  284. package/dist/cjs/src/helpers/DateTime.js +0 -4
  285. package/dist/esm/src/helpers/CalendarDate.js +0 -151
  286. package/dist/esm/src/helpers/DateTime.js +0 -4
  287. package/dist/types/src/helpers/CalendarDate.d.ts +0 -56
  288. package/dist/types/src/helpers/DateTime.d.ts +0 -6
  289. package/dist/types/src/types/luxon/_util.d.ts +0 -20
  290. package/dist/types/src/types/luxon/datetime.d.ts +0 -1759
  291. package/dist/types/src/types/luxon/duration.d.ts +0 -494
  292. package/dist/types/src/types/luxon/info.d.ts +0 -217
  293. package/dist/types/src/types/luxon/interval.d.ts +0 -357
  294. package/dist/types/src/types/luxon/misc.d.ts +0 -67
  295. package/dist/types/src/types/luxon/settings.d.ts +0 -91
  296. package/dist/types/src/types/luxon/zone.d.ts +0 -172
  297. package/docs/types/index.DateTime.html +0 -1
  298. package/docs/variables/index.DateTime-1.html +0 -1
@@ -1,1759 +0,0 @@
1
- import { CanBeInvalid, DefaultValidity, IfValid, Invalid, Valid } from './_util.js'
2
- import { Duration, DurationLike, DurationUnits, ToISOFormat } from './duration.js'
3
- import { Interval } from './interval.js'
4
- import { CalendarSystem, DateTimeFormatOptions, NumberingSystem, StringUnitLength } from './misc.js'
5
- import { Zone } from './zone.js'
6
-
7
- export type DateTimeUnit =
8
- | 'year'
9
- | 'quarter'
10
- | 'month'
11
- | 'week'
12
- | 'day'
13
- | 'hour'
14
- | 'minute'
15
- | 'second'
16
- | 'millisecond'
17
- export type ToRelativeUnit =
18
- | 'years'
19
- | 'quarters'
20
- | 'months'
21
- | 'weeks'
22
- | 'days'
23
- | 'hours'
24
- | 'minutes'
25
- | 'seconds'
26
-
27
- export type MonthNumbers = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
28
- export type WeekdayNumbers = 1 | 2 | 3 | 4 | 5 | 6 | 7
29
-
30
- export type DayNumbers =
31
- | 1
32
- | 2
33
- | 3
34
- | 4
35
- | 5
36
- | 6
37
- | 7
38
- | 8
39
- | 9
40
- | 10
41
- | 11
42
- | 12
43
- | 13
44
- | 14
45
- | 15
46
- | 16
47
- | 17
48
- | 18
49
- | 19
50
- | 20
51
- | 21
52
- | 22
53
- | 23
54
- | 24
55
- | 25
56
- | 26
57
- | 27
58
- | 28
59
- | 29
60
- | 30
61
- | 31
62
-
63
- export type SecondNumbers =
64
- | 0
65
- | 1
66
- | 2
67
- | 3
68
- | 4
69
- | 5
70
- | 6
71
- | 7
72
- | 8
73
- | 9
74
- | 10
75
- | 11
76
- | 12
77
- | 13
78
- | 14
79
- | 15
80
- | 16
81
- | 17
82
- | 18
83
- | 19
84
- | 20
85
- | 21
86
- | 22
87
- | 23
88
- | 24
89
- | 25
90
- | 26
91
- | 27
92
- | 28
93
- | 29
94
- | 30
95
- | 31
96
- | 32
97
- | 33
98
- | 34
99
- | 35
100
- | 36
101
- | 37
102
- | 38
103
- | 39
104
- | 40
105
- | 41
106
- | 42
107
- | 43
108
- | 44
109
- | 45
110
- | 46
111
- | 47
112
- | 48
113
- | 49
114
- | 50
115
- | 51
116
- | 52
117
- | 53
118
- | 54
119
- | 55
120
- | 56
121
- | 57
122
- | 58
123
- | 59
124
-
125
- export type MinuteNumbers = SecondNumbers
126
-
127
- export type HourNumbers =
128
- | 0
129
- | 1
130
- | 2
131
- | 3
132
- | 4
133
- | 5
134
- | 6
135
- | 7
136
- | 8
137
- | 9
138
- | 10
139
- | 11
140
- | 12
141
- | 13
142
- | 14
143
- | 15
144
- | 16
145
- | 17
146
- | 18
147
- | 19
148
- | 20
149
- | 21
150
- | 22
151
- | 23
152
-
153
- export type WeekNumbers =
154
- | 1
155
- | 2
156
- | 3
157
- | 4
158
- | 5
159
- | 6
160
- | 7
161
- | 8
162
- | 9
163
- | 10
164
- | 11
165
- | 12
166
- | 13
167
- | 14
168
- | 15
169
- | 16
170
- | 17
171
- | 18
172
- | 19
173
- | 20
174
- | 21
175
- | 22
176
- | 23
177
- | 24
178
- | 25
179
- | 26
180
- | 27
181
- | 28
182
- | 29
183
- | 30
184
- | 31
185
- | 32
186
- | 33
187
- | 34
188
- | 35
189
- | 36
190
- | 37
191
- | 38
192
- | 39
193
- | 40
194
- | 41
195
- | 42
196
- | 43
197
- | 44
198
- | 45
199
- | 46
200
- | 47
201
- | 48
202
- | 49
203
- | 50
204
- | 51
205
- | 52
206
- | 53
207
-
208
- export type QuarterNumbers = 1 | 2 | 3 | 4
209
-
210
- export type PossibleDaysInMonth = 28 | 29 | 30 | 31
211
- export type PossibleDaysInYear = 365 | 366
212
- export type PossibleWeeksInYear = 52 | 53
213
-
214
- export type ToObjectOutput<
215
- IncludeConfig extends boolean | undefined = undefined,
216
- IsValid extends boolean | undefined = undefined,
217
- > = IsValid extends true
218
- ? _ToObjectOutput<IncludeConfig>
219
- : CanBeInvalid extends false
220
- ? _ToObjectOutput<IncludeConfig>
221
- : Partial<_ToObjectOutput<IncludeConfig>>
222
- /** @internal */
223
- export type _ToObjectOutput<IncludeConfig extends boolean | undefined = undefined> = Record<
224
- _ToObjectUnit,
225
- number
226
- > &
227
- (IncludeConfig extends true ? LocaleOptions : unknown)
228
- /** @internal */
229
- export type _ToObjectUnit = Exclude<DateTimeUnit, 'quarter' | 'week'>
230
-
231
- export interface ToRelativeOptions extends Omit<ToRelativeCalendarOptions, 'unit'> {
232
- /**
233
- * @default long
234
- */
235
- style?: StringUnitLength | undefined
236
- /** @default true */
237
- round?: boolean | undefined
238
- /**
239
- * Padding in milliseconds. This allows you to round up the result if it fits inside the threshold.
240
- * Do not use this in combination with `{round: false}` because the decimal output will include the padding.
241
- * @default 0
242
- */
243
- padding?: number | undefined
244
- /**
245
- * A single unit or an array of units. If an array is supplied, the method will pick the best one
246
- * to use from the array. If omitted, the method will pick the unit from a default set.
247
- */
248
- unit?: ToRelativeUnit | ToRelativeUnit[] | undefined
249
- }
250
-
251
- export interface ToRelativeCalendarOptions {
252
- /**
253
- * The DateTime to use as the basis to which this time is compared
254
- * @default now
255
- */
256
- base?: DateTime | undefined
257
- /**
258
- * Override the locale of this DateTime
259
- */
260
- locale?: string | undefined
261
- /** If omitted, the method will pick the unit. */
262
- unit?: ToRelativeUnit | undefined
263
- /**
264
- * Override the numberingSystem of this DateTime.
265
- * The Intl system may choose not to honor this.
266
- */
267
- numberingSystem?: NumberingSystem | undefined
268
- }
269
-
270
- export interface ToSQLOptions {
271
- /**
272
- * Include the offset, such as 'Z' or '-04:00'
273
- * @default true
274
- */
275
- includeOffset?: boolean | undefined
276
- /**
277
- * Include the zone, such as 'America/New_York'. Overrides includeOffset.
278
- * @default false
279
- */
280
- includeZone?: boolean | undefined
281
- /**
282
- * include the space between the time and the offset, such as '05:15:16.345 -04:00'
283
- * @default true
284
- */
285
- includeOffsetSpace?: boolean
286
- }
287
-
288
- export interface ToISODateOptions {
289
- /**
290
- * Choose between the basic and extended format
291
- * @default 'extended'
292
- */
293
- format?: ToISOFormat | undefined
294
- }
295
-
296
- export interface ToISOTimeOptions extends ToISOTimeDurationOptions {
297
- /**
298
- * Include the offset, such as 'Z' or '-04:00'
299
- * @default true
300
- */
301
- includeOffset?: boolean | undefined
302
-
303
- /**
304
- * add the time zone format extension
305
- * @default false
306
- */
307
- extendedZone?: boolean | undefined
308
- }
309
-
310
- /** @deprecated alias for backwards compatibility */
311
- export type ISOTimeOptions = ToISOTimeOptions
312
-
313
- export interface LocaleOptions {
314
- /**
315
- * @default system's locale
316
- */
317
- locale?: string | undefined
318
- outputCalendar?: CalendarSystem | undefined
319
- numberingSystem?: NumberingSystem | undefined
320
- }
321
-
322
- export type ResolvedLocaleOptions = Required<LocaleOptions>
323
-
324
- export interface DateTimeOptions extends LocaleOptions {
325
- /**
326
- * Use this zone if no offset is specified in the input string itself. Will also convert the time to this zone.
327
- * @default local
328
- */
329
- zone?: string | Zone | undefined
330
- /**
331
- * Override the zone with a fixed-offset zone specified in the string itself, if it specifies one.
332
- * @default false
333
- */
334
- setZone?: boolean | undefined
335
- }
336
-
337
- export type DateTimeJSOptions = Omit<DateTimeOptions, 'setZone'>
338
-
339
- /**
340
- * Note that ISO weekday and local weekday fields are mutually exclusive
341
- */
342
- export interface DateObjectUnits {
343
- // a year, such as 1987
344
- year?: number | undefined
345
- // a month, 1-12
346
- month?: number | undefined
347
- // a day of the month, 1-31, depending on the month
348
- day?: number | undefined
349
- // day of the year, 1-365 or 366
350
- ordinal?: number | undefined
351
- // an ISO week year
352
- weekYear?: number | undefined
353
- // a week year, according to the locale
354
- localWeekYear?: number | undefined
355
- // an ISO week number, between 1 and 52 or 53, depending on the year
356
- weekNumber?: number | undefined
357
- // a week number, between 1 and 52 or 53, depending on the year, according to the locale
358
- localWeekNumber?: number | undefined
359
- // an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday
360
- weekday?: WeekdayNumbers | undefined
361
- // a weekday, 1-7, where 1 is the first day of the week, and 7 is the last, according to the locale
362
- localWeekday?: WeekdayNumbers | undefined
363
- // hour of the day, 0-23
364
- hour?: number | undefined
365
- // minute of the hour, 0-59
366
- minute?: number | undefined
367
- // second of the minute, 0-59
368
- second?: number | undefined
369
- // millisecond of the second, 0-999
370
- millisecond?: number | undefined
371
- }
372
-
373
- export type ConversionAccuracy = 'casual' | 'longterm'
374
-
375
- /**
376
- * @deprecated You should use `Intl.DateTimeFormatOptions` fields and values instead.
377
- */
378
- export type DateTimeFormatPresetValue = 'numeric' | 'short' | 'long'
379
- /**
380
- * @deprecated Use `Intl.DateTimeFormatOptions` instead.
381
- */
382
- export type DateTimeFormatPreset = Intl.DateTimeFormatOptions
383
-
384
- export interface DiffOptions {
385
- /**
386
- * @default 'casual'
387
- */
388
- conversionAccuracy?: ConversionAccuracy | undefined
389
- }
390
-
391
- export interface _UseLocaleWeekOption {
392
- /** If true, use weeks based on the locale, i.e., use the locale-dependent start of the week */
393
- useLocaleWeeks?: boolean
394
- }
395
-
396
- export type HasSameOptions = _UseLocaleWeekOption
397
- export type StartOfOptions = _UseLocaleWeekOption
398
- export type EndOfOptions = _UseLocaleWeekOption
399
-
400
- export interface ExplainedFormat {
401
- input: string
402
- tokens: Array<{ literal: boolean; val: string }>
403
- regex?: RegExp | undefined
404
- rawMatches?: RegExpMatchArray | null | undefined
405
- matches?: { [k: string]: any } | undefined
406
- result?: { [k: string]: any } | null | undefined
407
- zone?: Zone | null | undefined
408
- invalidReason?: string | undefined
409
- }
410
-
411
- export type DateTimeMaybeValid = CanBeInvalid extends true ? DateTime<Valid> | DateTime<Invalid> : DateTime
412
-
413
- /**
414
- * A DateTime is an immutable data structure representing a specific date and time and accompanying methods.
415
- * It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them.
416
- *
417
- * A DateTime consists of the following parts:
418
- * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch.
419
- * * A time zone. Each instance is considered in the context of a specific zone (by default, the local system's zone).
420
- * * Configuration properties that affect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`.
421
- *
422
- * Here is a brief overview of the most commonly used functionality it provides:
423
- *
424
- * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}.
425
- * To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}.
426
- * To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}.
427
- * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e. as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year},
428
- * {@link DateTime#month}, {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors.
429
- * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors.
430
- * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors.
431
- * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale},
432
- * {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}.
433
- * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO},
434
- * {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat},
435
- * {@link DateTime#toMillis} and {@link DateTime#toJSDate}.
436
- *
437
- * There's plenty others documented below. In addition, for more information on subtler topics
438
- * like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation.
439
- */
440
- export class DateTime<IsValid extends boolean = DefaultValidity> {
441
- /**
442
- * Create a DateTime for the current instant, in the system's time zone.
443
- *
444
- * Use Settings to override these default values if needed.
445
- * @example
446
- * DateTime.now().toISO() //~> now in the ISO format
447
- */
448
- static now(): DateTime<Valid>
449
-
450
- /**
451
- * Create a local DateTime
452
- *
453
- * @param year - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used
454
- * @param month - The month, 1-indexed
455
- * @param day - The day of the month, 1-indexed
456
- * @param hour - The hour of the day, in 24-hour time
457
- * @param minute - The minute of the hour, meaning a number between 0 and 59
458
- * @param second - The second of the minute, meaning a number between 0 and 59
459
- * @param millisecond - The millisecond of the second, meaning a number between 0 and 999
460
- * @param opts
461
- *
462
- * @example
463
- * DateTime.local() //~> now
464
- * @example
465
- * DateTime.local({ zone: "America/New_York" }) //~> now, in US east coast time
466
- * @example
467
- * DateTime.local(2017) //~> 2017-01-01T00:00:00
468
- * @example
469
- * DateTime.local(2017, 3) //~> 2017-03-01T00:00:00
470
- * @example
471
- * DateTime.local(2017, 3, 12, { locale: "fr") //~> 2017-03-12T00:00:00, with a French locale
472
- * @example
473
- * DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00
474
- * @example
475
- * DateTime.local(2017, 3, 12, 5, { zone: "utc" }) //~> 2017-03-12T05:00:00, in UTC
476
- * @example
477
- * DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00
478
- * @example
479
- * DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10
480
- * @example
481
- * DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765
482
- */
483
- static local(
484
- year: number,
485
- month: number,
486
- day: number,
487
- hour: number,
488
- minute: number,
489
- second: number,
490
- millisecond: number,
491
- opts?: DateTimeJSOptions
492
- ): DateTimeMaybeValid
493
- static local(
494
- year: number,
495
- month: number,
496
- day: number,
497
- hour: number,
498
- minute: number,
499
- second: number,
500
- opts?: DateTimeJSOptions
501
- ): DateTimeMaybeValid
502
- static local(
503
- year: number,
504
- month: number,
505
- day: number,
506
- hour: number,
507
- minute: number,
508
- opts?: DateTimeJSOptions
509
- ): DateTimeMaybeValid
510
- static local(
511
- year: number,
512
- month: number,
513
- day: number,
514
- hour: number,
515
- opts?: DateTimeJSOptions
516
- ): DateTimeMaybeValid
517
- static local(year: number, month: number, day: number, opts?: DateTimeJSOptions): DateTimeMaybeValid
518
- static local(year: number, month: number, opts?: DateTimeJSOptions): DateTimeMaybeValid
519
- static local(year: number, opts?: DateTimeJSOptions): DateTimeMaybeValid
520
- static local(opts?: DateTimeJSOptions): DateTime<Valid>
521
-
522
- /**
523
- * Create a DateTime in UTC
524
- *
525
- * @param year - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used
526
- * @param month - The month, 1-indexed
527
- * @param day - The day of the month
528
- * @param hour - The hour of the day, in 24-hour time
529
- * @param minute - The minute of the hour, meaning a number between 0 and 59
530
- * @param second - The second of the minute, meaning a number between 0 and 59
531
- * @param millisecond - The millisecond of the second, meaning a number between 0 and 999
532
- * @param options - configuration options for the DateTime
533
- * @param options.locale - a locale to set on the resulting DateTime instance
534
- * @param options.outputCalendar - the output calendar to set on the resulting DateTime instance
535
- * @param options.numberingSystem - the numbering system to set on the resulting DateTime instance
536
- *
537
- * @example
538
- * DateTime.utc() //~> now
539
- * @example
540
- * DateTime.utc(2017) //~> 2017-01-01T00:00:00Z
541
- * @example
542
- * DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z
543
- * @example
544
- * DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z
545
- * @example
546
- * DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z
547
- * @example
548
- * DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z
549
- * @example
550
- * DateTime.utc(2017, 3, 12, 5, 45, { locale: "fr" } ) //~> 2017-03-12T05:45:00Z with a French locale
551
- * @example
552
- * DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z
553
- * @example
554
- * DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: "fr") //~> 2017-03-12T05:45:10.765Z with a French locale
555
- */
556
- static utc(
557
- year: number,
558
- month: number,
559
- day: number,
560
- hour: number,
561
- minute: number,
562
- second: number,
563
- millisecond: number,
564
- options?: LocaleOptions
565
- ): DateTimeMaybeValid
566
- static utc(
567
- year: number,
568
- month: number,
569
- day: number,
570
- hour: number,
571
- minute: number,
572
- second: number,
573
- options?: LocaleOptions
574
- ): DateTimeMaybeValid
575
- static utc(
576
- year: number,
577
- month: number,
578
- day: number,
579
- hour: number,
580
- minute: number,
581
- options?: LocaleOptions
582
- ): DateTimeMaybeValid
583
- static utc(
584
- year: number,
585
- month: number,
586
- day: number,
587
- hour: number,
588
- options?: LocaleOptions
589
- ): DateTimeMaybeValid
590
- static utc(year: number, month: number, day: number, options?: LocaleOptions): DateTimeMaybeValid
591
- static utc(year: number, month: number, options?: LocaleOptions): DateTimeMaybeValid
592
- static utc(year: number, options?: LocaleOptions): DateTimeMaybeValid
593
- static utc(options?: LocaleOptions): DateTime<Valid>
594
-
595
- /**
596
- * Create a DateTime from a JavaScript Date object. Uses the default zone.
597
- *
598
- * @param date - a JavaScript Date object
599
- * @param options - configuration options for the DateTime
600
- * @param options.zone - the zone to place the DateTime into
601
- */
602
- static fromJSDate(date: Date, options?: { zone?: string | Zone }): DateTimeMaybeValid
603
-
604
- /**
605
- * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.
606
- *
607
- * @param milliseconds - a number of milliseconds since 1970 UTC
608
- * @param options - configuration options for the DateTime
609
- * @param options.zone - the zone to place the DateTime into. Defaults to 'local'.
610
- * @param options.locale - a locale to set on the resulting DateTime instance
611
- * @param options.outputCalendar - the output calendar to set on the resulting DateTime instance
612
- * @param options.numberingSystem - the numbering system to set on the resulting DateTime instance
613
- */
614
- static fromMillis(milliseconds: number, options?: DateTimeJSOptions): DateTimeMaybeValid
615
-
616
- /**
617
- * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.
618
- *
619
- * @param seconds - a number of seconds since 1970 UTC
620
- * @param options - configuration options for the DateTime
621
- * @param options.zone - the zone to place the DateTime into. Defaults to 'local'.
622
- * @param options.locale - a locale to set on the resulting DateTime instance
623
- * @param options.outputCalendar - the output calendar to set on the resulting DateTime instance
624
- * @param options.numberingSystem - the numbering system to set on the resulting DateTime instance
625
- */
626
- static fromSeconds(seconds: number, options?: DateTimeJSOptions): DateTime<Valid>
627
-
628
- /**
629
- * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.
630
- *
631
- * @param obj - the object to create the DateTime from
632
- * @param obj.year - a year, such as 1987
633
- * @param obj.month - a month, 1-12
634
- * @param obj.day - a day of the month, 1-31, depending on the month
635
- * @param obj.ordinal - day of the year, 1-365 or 366
636
- * @param obj.weekYear - an ISO week year
637
- * @param obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year
638
- * @param obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday
639
- * @param obj.hour - hour of the day, 0-23
640
- * @param obj.minute - minute of the hour, 0-59
641
- * @param obj.second - second of the minute, 0-59
642
- * @param obj.millisecond - millisecond of the second, 0-999
643
- * @param opts - options for creating this DateTime
644
- * @param opts.zone - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone(). Defaults to 'local'.
645
- * @param opts.locale - a locale to set on the resulting DateTime instance. Defaults to 'system's locale'.
646
- * @param opts.outputCalendar - the output calendar to set on the resulting DateTime instance
647
- * @param opts.numberingSystem - the numbering system to set on the resulting DateTime instance
648
- *
649
- * @example
650
- * DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25'
651
- * @example
652
- * DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01'
653
- * @example
654
- * DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //=> today at 10:26:06
655
- * @example
656
- * DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' })
657
- * @example
658
- * DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' })
659
- * @example
660
- * DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' })
661
- * @example
662
- * DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13'
663
- * @example
664
- * DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: 'en-US' }).toISODate() //=> '2021-12-26'
665
- */
666
- static fromObject(obj: DateObjectUnits, opts?: DateTimeJSOptions): DateTimeMaybeValid
667
-
668
- /**
669
- * Create a DateTime from an ISO 8601 string
670
- *
671
- * @param text - the ISO string
672
- * @param opts - options to affect the creation
673
- * @param opts.zone - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone. Defaults to 'local'.
674
- * @param opts.setZone - override the zone with a fixed-offset zone specified in the string itself, if it specifies one. Defaults to false.
675
- * @param opts.locale - a locale to set on the resulting DateTime instance. Defaults to 'system's locale'.
676
- * @param opts.outputCalendar - the output calendar to set on the resulting DateTime instance
677
- * @param opts.numberingSystem - the numbering system to set on the resulting DateTime instance
678
- *
679
- * @example
680
- * DateTime.fromISO('2016-05-25T09:08:34.123')
681
- * @example
682
- * DateTime.fromISO('2016-05-25T09:08:34.123+06:00')
683
- * @example
684
- * DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true})
685
- * @example
686
- * DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'})
687
- * @example
688
- * DateTime.fromISO('2016-W05-4')
689
- */
690
- static fromISO(text: string, opts?: DateTimeOptions): DateTimeMaybeValid
691
-
692
- /**
693
- * Create a DateTime from an RFC 2822 string
694
- *
695
- * @param text - the RFC 2822 string
696
- * @param opts - options to affect the creation
697
- * @param opts.zone - convert the time to this zone. Since the offset is always specified in the string itself,
698
- * this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in. Defaults to 'local'
699
- * @param opts.setZone - override the zone with a fixed-offset zone specified in the string itself, if it specifies one. Defaults to false.
700
- * @param opts.locale - a locale to set on the resulting DateTime instance. Defaults to 'system's locale'.
701
- * @param opts.outputCalendar - the output calendar to set on the resulting DateTime instance
702
- * @param opts.numberingSystem - the numbering system to set on the resulting DateTime instance
703
- *
704
- * @example
705
- * DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT')
706
- * @example
707
- * DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600')
708
- * @example
709
- * DateTime.fromRFC2822('25 Nov 2016 13:23 Z')
710
- */
711
- static fromRFC2822(text: string, opts?: DateTimeOptions): DateTimeMaybeValid
712
-
713
- /**
714
- * Create a DateTime from an HTTP header date
715
- *
716
- * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1
717
- *
718
- * @param text - the HTTP header date
719
- * @param opts - options to affect the creation
720
- * @param opts.zone - convert the time to this zone. Since HTTP dates are always in UTC,
721
- * this has no effect on the interpretation of string,merely the zone the resulting DateTime is expressed in. Defaults to 'local'.
722
- * @param opts.setZone - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC,
723
- * so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods. Defaults to false.
724
- * @param opts.locale - a locale to set on the resulting DateTime instance. Defaults to 'system's locale'.
725
- * @param opts.outputCalendar - the output calendar to set on the resulting DateTime instance
726
- * @param opts.numberingSystem - the numbering system to set on the resulting DateTime instance
727
- *
728
- * @example
729
- * DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT')
730
- * @example
731
- * DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT')
732
- * @example
733
- * DateTime.fromHTTP('Sun Nov 6 08:49:37 1994')
734
- */
735
- static fromHTTP(text: string, opts?: DateTimeOptions): DateTimeMaybeValid
736
-
737
- /**
738
- * Create a DateTime from an input string and format string.
739
- * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations,
740
- * see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens).
741
- *
742
- * @param text - the string to parse
743
- * @param fmt - the format the string is expected to be in (see the link below for the formats)
744
- * @param opts - options to affect the creation
745
- * @param opts.zone - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone. Defaults to 'local'.
746
- * @param opts.setZone - override the zone with a zone specified in the string itself, if it specifies one. Defaults to false.
747
- * @param opts.locale - a locale string to use when parsing. Will also set the DateTime to this locale. Defaults to 'en-US'.
748
- * @param opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system
749
- * @param opts.outputCalendar - the output calendar to set on the resulting DateTime instance
750
- */
751
- static fromFormat(text: string, fmt: string, opts?: DateTimeOptions): DateTimeMaybeValid
752
-
753
- /**
754
- * @deprecated use fromFormat instead
755
- */
756
- static fromString(text: string, format: string, options?: DateTimeOptions): DateTimeMaybeValid
757
-
758
- /**
759
- * Create a DateTime from a SQL date, time, or datetime
760
- * Defaults to en-US if no locale has been specified, regardless of the system's locale
761
- *
762
- * @param text - the string to parse
763
- * @param opts - options to affect the creation
764
- * @param opts.zone - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone. Defaults to 'local'.
765
- * @param opts.setZone - override the zone with a zone specified in the string itself, if it specifies one. Defaults to false.
766
- * @param opts.locale - a locale string to use when parsing. Will also set the DateTime to this locale. Defaults to 'en-US'.
767
- * @param opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system
768
- * @param opts.outputCalendar - the output calendar to set on the resulting DateTime instance
769
- *
770
- * @example
771
- * DateTime.fromSQL('2017-05-15')
772
- * @example
773
- * DateTime.fromSQL('2017-05-15 09:12:34')
774
- * @example
775
- * DateTime.fromSQL('2017-05-15 09:12:34.342')
776
- * @example
777
- * DateTime.fromSQL('2017-05-15 09:12:34.342+06:00')
778
- * @example
779
- * DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles')
780
- * @example
781
- * DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true })
782
- * @example
783
- * DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' })
784
- * @example
785
- * DateTime.fromSQL('09:12:34.342')
786
- */
787
- static fromSQL(text: string, opts?: DateTimeOptions): DateTimeMaybeValid
788
-
789
- /**
790
- * Create an invalid DateTime.
791
- *
792
- * @param reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent
793
- * @param explanation - longer explanation, may include parameters and other useful debugging information. Defaults to null.
794
- */
795
- static invalid(reason: string, explanation?: string): DateTime<Invalid>
796
-
797
- /**
798
- * Check if an object is a DateTime. Works across context boundaries
799
- *
800
- * @param o
801
- */
802
- static isDateTime(o: unknown): o is DateTimeMaybeValid
803
-
804
- /**
805
- * Produce the format string for a set of options
806
- *
807
- * @param formatOpts - Intl.DateTimeFormat constructor options and configuration options
808
- * @param localeOpts - Opts to override the configuration options on this DateTime
809
- *
810
- * @example
811
- * DateTime.parseFormatForOpts(DateTime.DATETIME_FULL); //=> "MMMM d, yyyyy, h:m a ZZZ"
812
- */
813
- static parseFormatForOpts(formatOpts?: DateTimeFormatOptions, localeOpts?: LocaleOptions): string | null
814
-
815
- /**
816
- * Produce the fully expanded format token for the locale
817
- * Does NOT quote characters, so quoted tokens will not round trip correctly
818
- * @param fmt - the format string
819
- * @param localeOpts - Opts to override the configuration options on this DateTime
820
- */
821
- static expandFormat(fmt: string, localeOpts?: LocaleOptions): string
822
-
823
- private constructor(config: unknown)
824
-
825
- // INFO
826
-
827
- /**
828
- * Get the value of unit.
829
- *
830
- * @param unit - a unit such as 'minute' or 'day'
831
- *
832
- * @example
833
- * DateTime.local(2017, 7, 4).get('month'); //=> 7
834
- * @example
835
- * DateTime.local(2017, 7, 4).get('day'); //=> 4
836
- */
837
- get(unit: keyof DateTime): number
838
-
839
- /**
840
- * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC in this DateTime's zone.
841
- * During DST changes local time can be ambiguous, for example 2023-10-29T02:30:00 in Europe/Berlin can have offset +01:00 or +02:00.
842
- * This method will return both possible DateTimes if this DateTime's local time is ambiguous.
843
- */
844
- getPossibleOffsets(): this[]
845
-
846
- /**
847
- * Returns whether the DateTime is valid. Invalid DateTimes occur when:
848
- * * The DateTime was created from invalid calendar information, such as the 13th month or February 30
849
- * * The DateTime was created by an operation on another invalid date
850
- */
851
- get isValid(): IfValid<true, false, IsValid>
852
-
853
- /**
854
- * Returns an error code if this DateTime is invalid, or null if the DateTime is valid
855
- */
856
- get invalidReason(): IfValid<null, string, IsValid>
857
-
858
- /**
859
- * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid
860
- */
861
- get invalidExplanation(): IfValid<null, string | null, IsValid>
862
-
863
- /**
864
- * Get the locale of a DateTime, such as 'en-GB'. The locale is used when formatting the DateTime
865
- */
866
- get locale(): IfValid<string, null, IsValid>
867
-
868
- /**
869
- * Get the numbering system of a DateTime, such as 'beng'. The numbering system is used when formatting the DateTime
870
- */
871
- get numberingSystem(): IfValid<string, null, IsValid>
872
-
873
- /**
874
- * Get the output calendar of a DateTime, such as 'islamic'. The output calendar is used when formatting the DateTime
875
- */
876
- get outputCalendar(): IfValid<string, null, IsValid>
877
-
878
- /**
879
- * Get the time zone associated with this DateTime.
880
- */
881
- get zone(): Zone<IsValid>
882
-
883
- /**
884
- * Get the name of the time zone.
885
- */
886
- get zoneName(): IfValid<string, null, IsValid>
887
-
888
- /**
889
- * Get the year
890
- *
891
- * @example DateTime.local(2017, 5, 25).year //=> 2017
892
- */
893
- get year(): IfValid<number, typeof NaN, IsValid>
894
-
895
- /**
896
- * Get the quarter
897
- *
898
- * @example DateTime.local(2017, 5, 25).quarter //=> 2
899
- */
900
- get quarter(): IfValid<QuarterNumbers, typeof NaN, IsValid>
901
-
902
- /**
903
- * Get the month (1-12).
904
- *
905
- * @example DateTime.local(2017, 5, 25).month //=> 5
906
- */
907
- get month(): IfValid<MonthNumbers, typeof NaN, IsValid>
908
-
909
- /**
910
- * Get the day of the month (1-30ish).
911
- *
912
- * @example DateTime.local(2017, 5, 25).day //=> 25
913
- */
914
- get day(): IfValid<DayNumbers, typeof NaN, IsValid>
915
-
916
- /**
917
- * Get the hour of the day (0-23).
918
- *
919
- * @example DateTime.local(2017, 5, 25, 9).hour //=> 9
920
- */
921
- get hour(): IfValid<HourNumbers, typeof NaN, IsValid>
922
-
923
- /**
924
- * Get the minute of the hour (0-59).
925
- *
926
- * @example
927
- * DateTime.local(2017, 5, 25, 9, 30).minute //=> 30
928
- */
929
- get minute(): IfValid<MinuteNumbers, typeof NaN, IsValid>
930
-
931
- /**
932
- * Get the second of the minute (0-59).
933
- *
934
- * @example
935
- * DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52
936
- */
937
- get second(): IfValid<SecondNumbers, typeof NaN, IsValid>
938
-
939
- /**
940
- * Get the millisecond of the second (0-999).
941
- *
942
- * @example
943
- * DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654
944
- */
945
- get millisecond(): IfValid<number, typeof NaN, IsValid>
946
-
947
- /**
948
- * Get the week year
949
- * @see https://en.wikipedia.org/wiki/ISO_week_date
950
- *
951
- * @example
952
- * DateTime.local(2014, 12, 31).weekYear //=> 2015
953
- */
954
- get weekYear(): IfValid<number, typeof NaN, IsValid>
955
-
956
- /**
957
- * Get the week number of the week year (1-52ish).
958
- * @see https://en.wikipedia.org/wiki/ISO_week_date
959
- *
960
- * @example
961
- * DateTime.local(2017, 5, 25).weekNumber //=> 21
962
- */
963
- get weekNumber(): IfValid<WeekNumbers, typeof NaN, IsValid>
964
-
965
- /**
966
- * Get the day of the week.
967
- * 1 is Monday and 7 is Sunday
968
- * @see https://en.wikipedia.org/wiki/ISO_week_date
969
- *
970
- * @example
971
- * DateTime.local(2014, 11, 31).weekday //=> 4
972
- */
973
- get weekday(): IfValid<WeekdayNumbers, typeof NaN, IsValid>
974
-
975
- /**
976
- * Returns true if this date is on a weekend, according to the locale, false otherwise
977
- */
978
- get isWeekend(): IfValid<boolean, false, IsValid>
979
-
980
- /**
981
- * Get the day of the week, according to the locale.
982
- * 1 is the first day of the week, and 7 is the last day of the week.
983
- * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1.
984
- */
985
- get localWeekday(): IfValid<WeekdayNumbers, typeof NaN, IsValid>
986
-
987
- /**
988
- * Get the week number of the week year, according to the locale.
989
- * Different locales assign week numbers differently.
990
- * The week can start on different days of the week (see {@link localWeekday}),
991
- * and because a different number of days is required for a week to count as the first week of a year.
992
- */
993
- get localWeekNumber(): IfValid<number, typeof NaN, IsValid>
994
-
995
- /**
996
- * Get the week year, according to the locale.
997
- * Different locales assign week numbers (and therefore week years) differently, see {@link localWeekNumber}.
998
- */
999
- get localWeekYear(): IfValid<number, typeof NaN, IsValid>
1000
-
1001
- /**
1002
- * Get the ordinal (meaning the day of the year)
1003
- *
1004
- * @example
1005
- * DateTime.local(2017, 5, 25).ordinal //=> 145
1006
- */
1007
- get ordinal(): IfValid<number, typeof NaN, IsValid>
1008
-
1009
- /**
1010
- * Get the human readable short month name, such as 'Oct'.
1011
- * Defaults to the system's locale if no locale has been specified
1012
- *
1013
- * @example
1014
- * DateTime.local(2017, 10, 30).monthShort //=> Oct
1015
- */
1016
- get monthShort(): IfValid<string, null, IsValid>
1017
-
1018
- /**
1019
- * Get the human readable long month name, such as 'October'.
1020
- * Defaults to the system's locale if no locale has been specified
1021
- *
1022
- * @example
1023
- * DateTime.local(2017, 10, 30).monthLong //=> October
1024
- */
1025
- get monthLong(): IfValid<string, null, IsValid>
1026
-
1027
- /**
1028
- * Get the human readable short weekday, such as 'Mon'.
1029
- * Defaults to the system's locale if no locale has been specified
1030
- *
1031
- * @example
1032
- * DateTime.local(2017, 10, 30).weekdayShort //=> Mon
1033
- */
1034
- get weekdayShort(): IfValid<string, null, IsValid>
1035
-
1036
- /**
1037
- * Get the human readable long weekday, such as 'Monday'.
1038
- * Defaults to the system's locale if no locale has been specified
1039
- *
1040
- * @example
1041
- * DateTime.local(2017, 10, 30).weekdayLong //=> Monday
1042
- */
1043
- get weekdayLong(): IfValid<string, null, IsValid>
1044
-
1045
- /**
1046
- * Get the UTC offset of this DateTime in minutes
1047
- *
1048
- * @example
1049
- * DateTime.now().offset //=> -240
1050
- * @example
1051
- * DateTime.utc().offset //=> 0
1052
- */
1053
- get offset(): IfValid<number, typeof NaN, IsValid>
1054
-
1055
- /**
1056
- * Get the short human name for the zone's current offset, for example "EST" or "EDT".
1057
- * Defaults to the system's locale if no locale has been specified
1058
- */
1059
- get offsetNameShort(): IfValid<string, null, IsValid>
1060
-
1061
- /**
1062
- * Get the long human name for the zone's current offset, for example "Eastern Standard Time" or "Eastern Daylight Time".
1063
- * Defaults to the system's locale if no locale has been specified
1064
- */
1065
- get offsetNameLong(): IfValid<string, null, IsValid>
1066
-
1067
- /**
1068
- * Get whether this zone's offset ever changes, as in a DST.
1069
- */
1070
- get isOffsetFixed(): IfValid<boolean, null, IsValid>
1071
-
1072
- /**
1073
- * Get whether the DateTime is in a DST.
1074
- */
1075
- get isInDST(): IfValid<boolean, false, IsValid>
1076
-
1077
- /**
1078
- * Returns true if this DateTime is in a leap year, false otherwise
1079
- *
1080
- * @example
1081
- * DateTime.local(2016).isInLeapYear //=> true
1082
- * @example
1083
- * DateTime.local(2013).isInLeapYear //=> false
1084
- */
1085
- get isInLeapYear(): boolean
1086
-
1087
- /**
1088
- * Returns the number of days in this DateTime's month
1089
- *
1090
- * @example
1091
- * DateTime.local(2016, 2).daysInMonth //=> 29
1092
- * @example
1093
- * DateTime.local(2016, 3).daysInMonth //=> 31
1094
- */
1095
- get daysInMonth(): IfValid<PossibleDaysInMonth, undefined, IsValid>
1096
-
1097
- /**
1098
- * Returns the number of days in this DateTime's year
1099
- *
1100
- * @example
1101
- * DateTime.local(2016).daysInYear //=> 366
1102
- * @example
1103
- * DateTime.local(2013).daysInYear //=> 365
1104
- */
1105
- get daysInYear(): IfValid<PossibleDaysInYear, typeof NaN, IsValid>
1106
-
1107
- /**
1108
- * Returns the number of weeks in this DateTime's year
1109
- * @see https://en.wikipedia.org/wiki/ISO_week_date
1110
- *
1111
- * @example
1112
- * DateTime.local(2004).weeksInWeekYear //=> 53
1113
- * @example
1114
- * DateTime.local(2013).weeksInWeekYear //=> 52
1115
- */
1116
- get weeksInWeekYear(): IfValid<PossibleWeeksInYear, typeof NaN, IsValid>
1117
-
1118
- /**
1119
- * Returns the number of weeks in this DateTime's local week year
1120
- *
1121
- * @example
1122
- * DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52
1123
- * @example
1124
- * DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53
1125
- */
1126
- get weeksInLocalWeekYear(): IfValid<PossibleWeeksInYear, typeof NaN, IsValid>
1127
-
1128
- /**
1129
- * Returns the resolved Intl options for this DateTime.
1130
- * This is useful in understanding the behavior of formatting methods
1131
- *
1132
- * @param opts - the same options as toLocaleString
1133
- */
1134
- resolvedLocaleOptions(opts?: LocaleOptions | DateTimeFormatOptions): ResolvedLocaleOptions
1135
-
1136
- // TRANSFORM
1137
-
1138
- /**
1139
- * "Set" the DateTime's zone to UTC. Returns a newly-constructed DateTime.
1140
- *
1141
- * Equivalent to {@link DateTime.setZone}('utc')
1142
- *
1143
- * @param offset - optionally, an offset from UTC in minutes. Defaults to 0.
1144
- * @param opts - options to pass to `setZone()`. Defaults to {}.
1145
- */
1146
- toUTC(offset?: number, opts?: ZoneOptions): this
1147
-
1148
- /**
1149
- * "Set" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.
1150
- *
1151
- * Equivalent to `setZone('local')`
1152
- */
1153
- toLocal(): this
1154
-
1155
- /**
1156
- * "Set" the DateTime's zone to specified zone. Returns a newly-constructed DateTime.
1157
- *
1158
- * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations,
1159
- * as with {@link DateTime.plus}. You may wish to use {@link DateTime.toLocal} and {@link DateTime.toUTC} which provide simple convenience wrappers for commonly used zones.
1160
- *
1161
- * @param zone - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'.
1162
- * You may also supply an instance of a {@link Zone} class. Defaults to 'local'.
1163
- * @param opts - options
1164
- * @param opts.keepLocalTime - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this. Defaults to false.
1165
- */
1166
- setZone(zone?: string | Zone, opts?: ZoneOptions): DateTimeMaybeValid
1167
-
1168
- /**
1169
- * "Set" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.
1170
- *
1171
- * @param properties - the properties to set
1172
- *
1173
- * @example
1174
- * DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' })
1175
- */
1176
- reconfigure(properties: LocaleOptions): this
1177
-
1178
- /**
1179
- * "Set" the locale. Returns a newly-constructed DateTime.
1180
- * Just a convenient alias for reconfigure({ locale })
1181
- *
1182
- * @example
1183
- * DateTime.local(2017, 5, 25).setLocale('en-GB')
1184
- */
1185
- setLocale(locale: string): this
1186
-
1187
- /**
1188
- * "Set" the values of specified units. Returns a newly-constructed DateTime.
1189
- * You can only set units with this method; for "setting" metadata, see {@link DateTime.reconfigure} and {@link DateTime.setZone}.
1190
- *
1191
- * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`.
1192
- * They cannot be mixed with ISO-week units like `weekday`.
1193
- *
1194
- * @example
1195
- * dt.set({ year: 2017 })
1196
- * @example
1197
- * dt.set({ hour: 8, minute: 30 })
1198
- * @example
1199
- * dt.set({ weekday: 5 })
1200
- * @example
1201
- * dt.set({ year: 2005, ordinal: 234 })
1202
- */
1203
- set(values: DateObjectUnits): this
1204
-
1205
- /**
1206
- * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar,
1207
- * accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between.
1208
- *
1209
- * @param duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()
1210
- *
1211
- * @example
1212
- * DateTime.now().plus(123) //~> in 123 milliseconds
1213
- * @example
1214
- * DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes
1215
- * @example
1216
- * DateTime.now().plus({ days: 1 }) //~> this time tomorrow
1217
- * @example
1218
- * DateTime.now().plus({ days: -1 }) //~> this time yesterday
1219
- * @example
1220
- * DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min
1221
- * @example
1222
- * DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min
1223
- */
1224
- plus(duration: DurationLike): this
1225
-
1226
- /**
1227
- * See {@link DateTime.plus}
1228
- *
1229
- * @param duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()
1230
- */
1231
- minus(duration: DurationLike): this
1232
-
1233
- /**
1234
- * "Set" this DateTime to the beginning of the given unit.
1235
- *
1236
- * @param unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.
1237
- * @param opts - options
1238
- *
1239
- * @example
1240
- * DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01'
1241
- * @example
1242
- * DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01'
1243
- * @example
1244
- * DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays
1245
- * @example
1246
- * DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00'
1247
- * @example
1248
- * DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00'
1249
- */
1250
- startOf(unit: DateTimeUnit, opts?: StartOfOptions): this
1251
-
1252
- /**
1253
- * "Set" this DateTime to the end (meaning the last millisecond) of a unit of time
1254
- *
1255
- * @param unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.
1256
- * @param opts - options
1257
- *
1258
- * @example
1259
- * DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00'
1260
- * @example
1261
- * DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00'
1262
- * @example
1263
- * DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays
1264
- * @example
1265
- * DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00'
1266
- * @example
1267
- * DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00'
1268
- */
1269
- endOf(unit: DateTimeUnit, opts?: EndOfOptions): this
1270
-
1271
- // OUTPUT
1272
-
1273
- /**
1274
- * Returns a string representation of this DateTime formatted according to the specified format string.
1275
- * **You may not want this.** See {@link DateTime.toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations,
1276
- * see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens).
1277
- * Defaults to en-US if no locale has been specified, regardless of the system's locale.
1278
- *
1279
- * @param fmt - the format string
1280
- * @param opts - opts to override the configuration options on this DateTime
1281
- *
1282
- * @example
1283
- * DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22'
1284
- * @example
1285
- * DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22'
1286
- * @example
1287
- * DateTime.now().toFormat('yyyy LLL dd', { locale: "fr" }) //=> '2017 avr. 22'
1288
- * @example
1289
- * DateTime.now().toFormat("HH 'hours and' mm 'minutes'") //=> '20 hours and 55 minutes'
1290
- */
1291
- toFormat(fmt: string, opts?: LocaleOptions): IfValid<string, 'Invalid DateTime', IsValid>
1292
-
1293
- /**
1294
- * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon,
1295
- * such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE` of the DateTime in the assigned locale.
1296
- * Defaults to the system's locale if no locale has been specified
1297
- * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat
1298
- *
1299
- * @param formatOpts - Intl.DateTimeFormat constructor options and configuration options
1300
- * @param opts - opts to override the configuration options on this DateTime
1301
- *
1302
- * @example
1303
- * DateTime.now().toLocaleString(); //=> 4/20/2017
1304
- * @example
1305
- * DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017'
1306
- * @example
1307
- * DateTime.now().toLocaleString({ locale: 'en-gb' }); //=> '20/04/2017'
1308
- * @example
1309
- * DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017'
1310
- * @example
1311
- * DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM'
1312
- * @example
1313
- * DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM'
1314
- * @example
1315
- * DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20'
1316
- * @example
1317
- * DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM'
1318
- * @example
1319
- * DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32'
1320
- */
1321
- toLocaleString(
1322
- formatOpts?: DateTimeFormatOptions,
1323
- opts?: LocaleOptions
1324
- ): IfValid<string, 'Invalid DateTime', IsValid>
1325
-
1326
- /**
1327
- * Returns an array of format "parts", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.
1328
- * Defaults to the system's locale if no locale has been specified
1329
- * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts
1330
- *
1331
- * @example
1332
- * DateTime.now().toLocaleParts(); //=> [
1333
- * //=> { type: 'day', value: '25' },
1334
- * //=> { type: 'literal', value: '/' },
1335
- * //=> { type: 'month', value: '05' },
1336
- * //=> { type: 'literal', value: '/' },
1337
- * //=> { type: 'year', value: '1982' }
1338
- * //=> ]
1339
- * @example
1340
- * DateTime.invalid('').toLocaleParts(); //=> []
1341
- */
1342
- toLocaleParts(opts?: DateTimeFormatOptions): Intl.DateTimeFormatPart[]
1343
-
1344
- /**
1345
- * Returns an ISO 8601-compliant string representation of this DateTime
1346
- *
1347
- * @example
1348
- * DateTime.utc(1982, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z'
1349
- * @example
1350
- * DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00'
1351
- * @example
1352
- * DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335'
1353
- * @example
1354
- * DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400'
1355
- */
1356
- toISO(opts?: ToISOTimeOptions): IfValid<string, null, IsValid>
1357
-
1358
- /**
1359
- * Returns an ISO 8601-compliant string representation of this DateTime's date component
1360
- *
1361
- * @param opts - options
1362
- * @param opts.format - choose between the basic and extended format. Defaults to 'extended'.
1363
- *
1364
- * @example
1365
- * DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25'
1366
- * @example
1367
- * DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525'
1368
- */
1369
- toISODate(opts?: ToISODateOptions): IfValid<string, null, IsValid>
1370
-
1371
- /**
1372
- * Returns an ISO 8601-compliant string representation of this DateTime's week date
1373
- *
1374
- * @example
1375
- * DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2'
1376
- */
1377
- toISOWeekDate(): IfValid<string, null, IsValid>
1378
-
1379
- /**
1380
- * Returns an ISO 8601-compliant string representation of this DateTime's time component
1381
- *
1382
- * @param opts - options
1383
- * @param opts.suppressMilliseconds - exclude milliseconds from the format if they're 0. Defaults to false.
1384
- * @param opts.suppressSeconds - exclude seconds from the format if they're 0. Defaults to false.
1385
- * @param opts.includeOffset - include the offset, such as 'Z' or '-04:00'. Defaults to true.
1386
- * @param opts.includePrefix - include the `T` prefix. Defaults to false.
1387
- * @param opts.format - choose between the basic and extended format. Defaults to 'extended'.
1388
- *
1389
- * @example
1390
- * DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z'
1391
- * @example
1392
- * DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z'
1393
- * @example
1394
- * DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z'
1395
- * @example
1396
- * DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z'
1397
- */
1398
- toISOTime(opts?: ToISOTimeOptions): IfValid<string, null, IsValid>
1399
-
1400
- /**
1401
- * Returns an RFC 2822-compatible string representation of this DateTime, always in UTC
1402
- *
1403
- * @example
1404
- * DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000'
1405
- * @example
1406
- * DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400'
1407
- */
1408
- toRFC2822(): IfValid<string, null, IsValid>
1409
-
1410
- /**
1411
- * Returns a string representation of this DateTime appropriate for use in HTTP headers.
1412
- * Specifically, the string conforms to RFC 1123.
1413
- * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1
1414
- *
1415
- * @example
1416
- * DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT'
1417
- * @example
1418
- * DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT'
1419
- */
1420
- toHTTP(): IfValid<string, null, IsValid>
1421
-
1422
- /**
1423
- * Returns a string representation of this DateTime appropriate for use in SQL Date
1424
- *
1425
- * @example
1426
- * DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13'
1427
- */
1428
- toSQLDate(): IfValid<string, null, IsValid>
1429
-
1430
- /**
1431
- * Returns a string representation of this DateTime appropriate for use in SQL Time
1432
- *
1433
- * @example
1434
- * DateTime.utc().toSQL() //=> '05:15:16.345'
1435
- * @example
1436
- * DateTime.now().toSQL() //=> '05:15:16.345 -04:00'
1437
- * @example
1438
- * DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345'
1439
- * @example
1440
- * DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York'
1441
- */
1442
- toSQLTime(opts?: ToSQLOptions): IfValid<string, null, IsValid>
1443
-
1444
- /**
1445
- * Returns a string representation of this DateTime for use in SQL DateTime
1446
- *
1447
- * @example
1448
- * DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z'
1449
- * @example
1450
- * DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00'
1451
- * @example
1452
- * DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000'
1453
- * @example
1454
- * DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York'
1455
- */
1456
- toSQL(opts?: ToSQLOptions): IfValid<string, null, IsValid>
1457
-
1458
- /**
1459
- * Returns a string representation of this DateTime appropriate for debugging
1460
- */
1461
- toString(): IfValid<string, 'Invalid DateTime', IsValid>
1462
-
1463
- /**
1464
- * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime.toMillis}
1465
- */
1466
- valueOf(): IfValid<number, typeof NaN, IsValid>
1467
-
1468
- /**
1469
- * Returns the epoch milliseconds of this DateTime.
1470
- */
1471
- toMillis(): IfValid<number, typeof NaN, IsValid>
1472
-
1473
- /**
1474
- * Returns the epoch seconds of this DateTime.
1475
- */
1476
- toSeconds(): IfValid<number, typeof NaN, IsValid>
1477
-
1478
- /**
1479
- * Returns the epoch seconds (as a whole number) of this DateTime.
1480
- */
1481
- toUnixInteger(): IfValid<number, typeof NaN, IsValid>
1482
-
1483
- /**
1484
- * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.
1485
- */
1486
- toJSON(): IfValid<string, null, IsValid>
1487
-
1488
- /**
1489
- * Returns a BSON-serializable equivalent to this DateTime.
1490
- */
1491
- toBSON(): Date
1492
-
1493
- /**
1494
- * Returns a JavaScript object with this DateTime's year, month, day, and so on.
1495
- *
1496
- * @param opts - options for generating the object
1497
- * @param opts.includeConfig - include configuration attributes in the output. Defaults to false.
1498
- *
1499
- * @example
1500
- * DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 }
1501
- */
1502
- toObject<IncludeConfig extends boolean | undefined>(opts?: {
1503
- /**
1504
- * Include configuration attributes in the output
1505
- * @defaultValue false
1506
- */
1507
- includeConfig?: IncludeConfig
1508
- }): ToObjectOutput<IncludeConfig, IsValid>
1509
-
1510
- /**
1511
- * Returns a JavaScript Date equivalent to this DateTime.
1512
- */
1513
- toJSDate(): Date
1514
-
1515
- // COMPARE
1516
-
1517
- /**
1518
- * Return the difference between two DateTimes as a Duration.
1519
- *
1520
- * @param otherDateTime - the DateTime to compare this one to
1521
- * @param unit - the unit or array of units to include in the duration.
1522
- * Defaults to ['milliseconds'].
1523
- * @param opts - options that affect the creation of the Duration
1524
- * @param opts.conversionAccuracy - the conversion system to use.
1525
- * Defaults to 'casual'.
1526
- *
1527
- * @example
1528
- * let i1 = DateTime.fromISO('1982-05-25T09:45'),
1529
- * i2 = DateTime.fromISO('1983-10-14T10:30');
1530
- * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 }
1531
- * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 }
1532
- * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 }
1533
- * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 }
1534
- */
1535
- diff(otherDateTime: DateTime, unit?: DurationUnits, opts?: DiffOptions): Duration<IsValid>
1536
-
1537
- /**
1538
- * Return the difference between this DateTime and right now.
1539
- * See {@link DateTime.diff}
1540
- *
1541
- * @param unit - the unit(s) to include in the duration. Defaults to ['milliseconds'].
1542
- * @param opts - options that affect the creation of the Duration
1543
- * @param opts.conversionAccuracy - the conversion system to use. Defaults to 'casual'.
1544
- */
1545
- diffNow(unit?: DurationUnits, opts?: DiffOptions): Duration<Valid>
1546
-
1547
- /**
1548
- * Return an Interval spanning between this DateTime and another DateTime
1549
- *
1550
- * @param otherDateTime - the other end point of the Interval
1551
- */
1552
- until(otherDateTime: DateTime): IfValid<Interval<Valid>, DateTime<Invalid>, IsValid>
1553
-
1554
- /**
1555
- * Return whether this DateTime is in the same unit of time as another DateTime.
1556
- * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime.setZone} to convert one of the dates if needed.
1557
- *
1558
- * @param otherDateTime - the other DateTime
1559
- * @param unit - the unit of time to check sameness on
1560
- *
1561
- * @example
1562
- * DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day
1563
- */
1564
- hasSame(
1565
- otherDateTime: DateTime,
1566
- unit: DateTimeUnit,
1567
- opts?: HasSameOptions
1568
- ): IfValid<boolean, false, IsValid>
1569
-
1570
- /**
1571
- * An equality check.
1572
- * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid.
1573
- * To compare just the millisecond values, use `+dt1 === +dt2`.
1574
- *
1575
- * @param other - the other DateTime
1576
- */
1577
- equals(other: DateTime): IfValid<boolean, false, IsValid>
1578
-
1579
- /**
1580
- * Returns a string representation of this time relative to now, such as "in two days".
1581
- * Can only internationalize if your platform supports Intl.RelativeTimeFormat.
1582
- * Rounds down by default.
1583
- *
1584
- * @example
1585
- * DateTime.now().plus({ days: 1 }).toRelative() //=> "in 1 day"
1586
- * @example
1587
- * DateTime.now().setLocale("es").toRelative({ days: 1 }) //=> "dentro de 1 día"
1588
- * @example
1589
- * DateTime.now().plus({ days: 1 }).toRelative({ locale: "fr" }) //=> "dans 23 heures"
1590
- * @example
1591
- * DateTime.now().minus({ days: 2 }).toRelative() //=> "2 days ago"
1592
- * @example
1593
- * DateTime.now().minus({ days: 2 }).toRelative({ unit: "hours" }) //=> "48 hours ago"
1594
- * @example
1595
- * DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> "1.5 days ago"
1596
- */
1597
- toRelative(options?: ToRelativeOptions): IfValid<string, null, IsValid>
1598
-
1599
- /**
1600
- * Returns a string representation of this date relative to today, such as "yesterday" or "next month".
1601
- * Only internationalizes on platforms that support Intl.RelativeTimeFormat.
1602
- *
1603
- * @example
1604
- * DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> "tomorrow"
1605
- * @example
1606
- * DateTime.now().setLocale("es").plus({ days: 1 }).toRelative() //=> ""mañana"
1607
- * @example
1608
- * DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: "fr" }) //=> "demain"
1609
- * @example
1610
- * DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> "2 days ago"
1611
- */
1612
- toRelativeCalendar(options?: ToRelativeCalendarOptions): IfValid<string, null, IsValid>
1613
-
1614
- /**
1615
- * Return the min of several date times
1616
- *
1617
- * @param dateTimes - the DateTimes from which to choose the minimum
1618
- */
1619
- static min<AllValid extends boolean>(
1620
- ...dateTimes: Array<DateTime<AllValid>>
1621
- ): (AllValid extends true ? DateTime<Valid> : never) | (AllValid extends false ? DateTime<Invalid> : never)
1622
-
1623
- /**
1624
- * Return the max of several date times
1625
- *
1626
- * @param dateTimes - the DateTimes from which to choose the maximum
1627
- */
1628
- static max<AllValid extends boolean>(
1629
- ...dateTimes: Array<DateTime<AllValid>>
1630
- ): (AllValid extends true ? DateTime<Valid> : never) | (AllValid extends false ? DateTime<Invalid> : never)
1631
-
1632
- // MISC
1633
-
1634
- /**
1635
- * Explain how a string would be parsed by fromFormat()
1636
- *
1637
- * @param text - the string to parse
1638
- * @param fmt - the format the string is expected to be in (see description)
1639
- * @param options - options taken by fromFormat()
1640
- */
1641
- static fromFormatExplain(text: string, fmt: string, options?: DateTimeOptions): ExplainedFormat
1642
-
1643
- /**
1644
- * @deprecated use fromFormatExplain instead
1645
- */
1646
- static fromStringExplain(text: string, fmt: string, options?: DateTimeOptions): ExplainedFormat
1647
-
1648
- // FORMAT PRESETS
1649
-
1650
- /**
1651
- * {@link DateTime.toLocaleString} format like 10/14/1983
1652
- */
1653
- static get DATE_SHORT(): Intl.DateTimeFormatOptions
1654
-
1655
- /**
1656
- * {@link DateTime.toLocaleString} format like 'Oct 14, 1983'
1657
- */
1658
- static get DATE_MED(): Intl.DateTimeFormatOptions
1659
-
1660
- /**
1661
- * {@link DateTime.toLocaleString} format like 'Fri, Oct 14, 1983'
1662
- */
1663
- static get DATE_MED_WITH_WEEKDAY(): Intl.DateTimeFormatOptions
1664
-
1665
- /**
1666
- * {@link DateTime.toLocaleString} format like 'October 14, 1983'
1667
- */
1668
- static get DATE_FULL(): Intl.DateTimeFormatOptions
1669
-
1670
- /**
1671
- * {@link DateTime.toLocaleString} format like 'Tuesday, October 14, 1983'
1672
- */
1673
- static get DATE_HUGE(): Intl.DateTimeFormatOptions
1674
-
1675
- /**
1676
- * {@link DateTime.toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.
1677
- */
1678
- static get TIME_SIMPLE(): Intl.DateTimeFormatOptions
1679
-
1680
- /**
1681
- * {@link DateTime.toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.
1682
- */
1683
- static get TIME_WITH_SECONDS(): Intl.DateTimeFormatOptions
1684
-
1685
- /**
1686
- * {@link DateTime.toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.
1687
- */
1688
- static get TIME_WITH_SHORT_OFFSET(): Intl.DateTimeFormatOptions
1689
-
1690
- /**
1691
- * {@link DateTime.toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.
1692
- */
1693
- static get TIME_WITH_LONG_OFFSET(): Intl.DateTimeFormatOptions
1694
-
1695
- /**
1696
- * {@link DateTime.toLocaleString} format like '09:30', always 24-hour.
1697
- */
1698
- static get TIME_24_SIMPLE(): Intl.DateTimeFormatOptions
1699
-
1700
- /**
1701
- * {@link DateTime.toLocaleString} format like '09:30:23', always 24-hour.
1702
- */
1703
- static get TIME_24_WITH_SECONDS(): Intl.DateTimeFormatOptions
1704
-
1705
- /**
1706
- * {@link DateTime.toLocaleString} format like '09:30:23 EDT', always 24-hour.
1707
- */
1708
- static get TIME_24_WITH_SHORT_OFFSET(): Intl.DateTimeFormatOptions
1709
-
1710
- /**
1711
- * {@link DateTime.toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.
1712
- */
1713
- static get TIME_24_WITH_LONG_OFFSET(): Intl.DateTimeFormatOptions
1714
-
1715
- /**
1716
- * {@link DateTime.toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.
1717
- */
1718
- static get DATETIME_SHORT(): Intl.DateTimeFormatOptions
1719
-
1720
- /**
1721
- * {@link DateTime.toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.
1722
- */
1723
- static get DATETIME_SHORT_WITH_SECONDS(): Intl.DateTimeFormatOptions
1724
-
1725
- /**
1726
- * {@link DateTime.toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.
1727
- */
1728
- static get DATETIME_MED(): Intl.DateTimeFormatOptions
1729
-
1730
- /**
1731
- * {@link DateTime.toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.
1732
- */
1733
- static get DATETIME_MED_WITH_SECONDS(): Intl.DateTimeFormatOptions
1734
-
1735
- /**
1736
- * {@link DateTime.toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.
1737
- */
1738
- static get DATETIME_MED_WITH_WEEKDAY(): Intl.DateTimeFormatOptions
1739
-
1740
- /**
1741
- * {@link DateTime.toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.
1742
- */
1743
- static get DATETIME_FULL(): Intl.DateTimeFormatOptions
1744
-
1745
- /**
1746
- * {@link DateTime.toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.
1747
- */
1748
- static get DATETIME_FULL_WITH_SECONDS(): Intl.DateTimeFormatOptions
1749
-
1750
- /**
1751
- * {@link DateTime.toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.
1752
- */
1753
- static get DATETIME_HUGE(): Intl.DateTimeFormatOptions
1754
-
1755
- /**
1756
- * {@link DateTime.toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.
1757
- */
1758
- static get DATETIME_HUGE_WITH_SECONDS(): Intl.DateTimeFormatOptions
1759
- }