repo
stringclasses
15 values
pull_number
int64
147
18.3k
instance_id
stringlengths
14
31
issue_numbers
listlengths
1
3
base_commit
stringlengths
40
40
patch
stringlengths
289
585k
test_patch
stringlengths
355
6.82M
problem_statement
stringlengths
25
49.4k
hints_text
stringlengths
0
58.9k
created_at
timestamp[us, tz=UTC]date
2014-08-08 22:09:38
2024-06-28 03:13:12
version
stringclasses
110 values
PASS_TO_PASS
listlengths
0
4.82k
FAIL_TO_PASS
listlengths
1
1.06k
language
stringclasses
4 values
image_urls
listlengths
0
4
website links
listlengths
0
4
babel/babel
15,948
babel__babel-15948
[ "15945" ]
3688240966dc974ae7cbde01c1e131516d72f591
diff --git a/packages/babel-plugin-transform-object-super/src/index.ts b/packages/babel-plugin-transform-object-super/src/index.ts --- a/packages/babel-plugin-transform-object-super/src/index.ts +++ b/packages/babel-plugin-transform-object-super/src/index.ts @@ -24,11 +24,30 @@ export default declare(api => { ? ...
diff --git a/packages/babel-plugin-transform-object-super/test/fixtures/object-super/loop-es5-compat/exec.js b/packages/babel-plugin-transform-object-super/test/fixtures/object-super/loop-es5-compat/exec.js new file mode 100644 --- /dev/null +++ b/packages/babel-plugin-transform-object-super/test/fixtures/object-super/...
[Bug]: `plugin-transform-object-super` incorrect output where object created in a loop ### 💻 - [ ] Would you like to work on a fix? ### How are you using Babel? Programmatic API (`babel.transform`, `babel.parse`) ### Input code ```js const objects = []; for (const proto of [{x: 0}, {x: 1}]) { objects.push({ ...
Hey @overlookmotel! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript quest...
2023-09-08T13:03:44Z
7.23
[]
[ "packages/babel-plugin-transform-object-super/test/index.js" ]
TypeScript
[]
[ "https://babeljs.io/repl#?browsers=defaults%2C%20not%20ie%2011%2C%20not%20ie_mob%2011&build=&builtIns=false&corejs=3.21&spec=false&loose=false&code_lz=MYewdgzgLgBCBGArApsKEYF4YG0C6A3AFABmIATjABSiSwAO5IUIcJuA3gB4BcMADAF8ANDG58AjILwBKMURhwkqdADp6AVwgALKhwWKYAfSONmIE3zMthBxWRBU5-w4fLIoG8mBgQN9ZHJVLjsYQQNBGWJwgEMICECoK...
babel/babel
16,015
babel__babel-16015
[ "16014" ]
a345a102f6cc1d384946b165d6375f503f2ae2a3
diff --git a/packages/babel-helper-module-transforms/src/index.ts b/packages/babel-helper-module-transforms/src/index.ts --- a/packages/babel-helper-module-transforms/src/index.ts +++ b/packages/babel-helper-module-transforms/src/index.ts @@ -557,6 +557,7 @@ function buildExportInitializationStatements( const InitTemp...
diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-named-6/input.mjs b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-named-6/input.mjs new file mode 100644 --- /dev/null +++ b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-named-6/input.mjs @@ ...
[Bug]: Wrong export value of `__proto__` in CommonJS ### 💻 - [X] Would you like to work on a fix? ### How are you using Babel? Programmatic API (`babel.transform`, `babel.parse`) ### Input code ```JavaScript export const __proto__ = null; import { __proto__ as p } from "./index.js"; console.log(p...
2023-10-01T05:22:39Z
7.23
[ "packages/babel-plugin-transform-modules-commonjs/test/copied-nodes.js", "packages/babel-plugin-transform-modules-commonjs/test/importInterop-function.js", "packages/babel-plugin-transform-modules-amd/test/importInterop-function.js", "packages/babel-plugin-transform-modules-umd/test/importInterop-function.js"...
[ "packages/babel-plugin-transform-modules-amd/test/index.js", "packages/babel-plugin-transform-modules-umd/test/index.js", "packages/babel-plugin-transform-modules-commonjs/test/index.js" ]
TypeScript
[]
[ "https://babeljs.io/repl#?browsers=chrome%20100&build=&builtIns=false&corejs=3.21&spec=false&loose=false&code_lz=KYDwDg9gTgLgBAYwgOwM7wPobFCMJZwC8cyArgDYUDcAULQJYC2kscA3nFjngRnAENUcMHAC-cAGa4mcAEQA6APQNkAE1AKAVqjl1aSNBArAFFCAHMAFGACUdIA&debug=false&forceAllTransforms=false&modules=commonjs&shippedProposals=false&ci...
babel/babel
16,022
babel__babel-16022
[ "16021" ]
8e7639fef3a4db4d4686c5531b913c89e61a2bae
diff --git a/packages/babel-preset-typescript/src/plugin-rewrite-ts-imports.ts b/packages/babel-preset-typescript/src/plugin-rewrite-ts-imports.ts --- a/packages/babel-preset-typescript/src/plugin-rewrite-ts-imports.ts +++ b/packages/babel-preset-typescript/src/plugin-rewrite-ts-imports.ts @@ -16,7 +16,9 @@ export defa...
diff --git a/packages/babel-preset-typescript/test/fixtures/opts/rewriteImportExtensions/input.ts b/packages/babel-preset-typescript/test/fixtures/opts/rewriteImportExtensions/input.ts --- a/packages/babel-preset-typescript/test/fixtures/opts/rewriteImportExtensions/input.ts +++ b/packages/babel-preset-typescript/test/...
`rewriteImportExtensions` option for TS preset does not work with .tsx files ### 💻 - [x] Would you like to work on this feature? ### What problem are you trying to solve? #15913 introduced a useful option for the TS preset which allows TS code authored using `"moduleResolution": "NodeNext"` and `"allowImportingTsEx...
Hey @jimmydief! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions...
2023-10-06T23:52:02Z
7.23
[ "packages/babel-preset-typescript/test/normalize-options.skip-bundled.js" ]
[ "packages/babel-preset-typescript/test/index.js" ]
TypeScript
[]
[]
babel/babel
16,071
babel__babel-16071
[ "15940" ]
c446ff85c28e117ebf3cd72cd34ef358f1077aa8
diff --git a/packages/babel-plugin-transform-typescript/src/global-types.ts b/packages/babel-plugin-transform-typescript/src/global-types.ts new file mode 100644 --- /dev/null +++ b/packages/babel-plugin-transform-typescript/src/global-types.ts @@ -0,0 +1,24 @@ +import type { NodePath, Scope } from "@babel/traverse"; +...
diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/namespace/export-type-only/input.ts b/packages/babel-plugin-transform-typescript/test/fixtures/namespace/export-type-only/input.ts new file mode 100644 --- /dev/null +++ b/packages/babel-plugin-transform-typescript/test/fixtures/namespace/export-type...
[Bug]: `@babel/preset-typescript@7.22.15` fails when exporting namespace ### 💻 - [x] Would you like to work on a fix? ### How are you using Babel? @rollup/plugin-babel ### Input code Building the following code with `@babel/preset-typescript` fails: ```js import type { Brand, NativeOrWebBrand } from './types'...
Hey @snitin315! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions...
2023-10-27T17:25:44Z
7.23
[]
[ "packages/babel-plugin-transform-typescript/test/index.js" ]
TypeScript
[]
[]
babel/babel
16,078
babel__babel-16078
[ "16077" ]
c446ff85c28e117ebf3cd72cd34ef358f1077aa8
diff --git a/packages/babel-generator/src/printer.ts b/packages/babel-generator/src/printer.ts --- a/packages/babel-generator/src/printer.ts +++ b/packages/babel-generator/src/printer.ts @@ -1016,16 +1016,19 @@ class Printer { const newlineRegex = new RegExp("\\n\\s{1," + offset + "}", "g"); val =...
diff --git a/packages/babel-generator/test/fixtures/comments/concise-block-comment-indent-2/input.js b/packages/babel-generator/test/fixtures/comments/concise-block-comment-indent-2/input.js new file mode 100644 --- /dev/null +++ b/packages/babel-generator/test/fixtures/comments/concise-block-comment-indent-2/input.js ...
[Bug]: RangeError: Invalid string length ### 💻 - [ ] Would you like to work on a fix? ### How are you using Babel? @babel/eslint-parser ### Input code ### Configuration file name _No response_ ### Configuration _No response_ ### Current and expected behavior RangeError: Invalid string...
Hey @Lookout-ent! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questio...
2023-10-31T22:33:06Z
7.23
[ "packages/babel-generator/test/arrow-functions.js", "packages/babel-generator/test/printer.skip-bundled.js" ]
[ "packages/babel-generator/test/index.js" ]
TypeScript
[]
[]
babel/babel
16,104
babel__babel-16104
[ "14797" ]
4f8dcbca58a43b1b18ceefd606de4520d055916b
diff --git a/packages/babel-generator/src/printer.ts b/packages/babel-generator/src/printer.ts --- a/packages/babel-generator/src/printer.ts +++ b/packages/babel-generator/src/printer.ts @@ -22,7 +22,6 @@ import type { TraceMap } from "@jridgewell/trace-mapping"; const SCIENTIFIC_NOTATION = /e/i; const ZERO_DECIMAL...
diff --git a/packages/babel-generator/test/fixtures/comments/pure-in-paren/input.js b/packages/babel-generator/test/fixtures/comments/pure-in-paren/input.js new file mode 100644 --- /dev/null +++ b/packages/babel-generator/test/fixtures/comments/pure-in-paren/input.js @@ -0,0 +1,4 @@ +(/* @__PURE__ */ f()).g(); +(/* @_...
[Bug]: Pure annotations are incorrectly modified to wrong scope ### 💻 - [ ] Would you like to work on a fix? ### How are you using Babel? Programmatic API (`babel.transform`, `babel.parse`) ### Input code ```js (/* @__PURE__ */ f()).g() ``` [REPL Link](https://babel.dev/repl#?browsers=&build=&builtIns=false&...
Hey @hyrious! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, ...
2023-11-15T11:30:07Z
7.23
[ "packages/babel-generator/test/arrow-functions.js", "packages/babel-generator/test/printer.skip-bundled.js" ]
[ "packages/babel-generator/test/index.js" ]
TypeScript
[]
[ "https://babel.dev/repl#?browsers=&build=&builtIns=false&corejs=3.21&spec=false&loose=false&code_lz=BQegVABAAg-jAKBVASgUThMIIDNgEp8A6AcwKA&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=false&timeTravel=false&sourceType=module&lineWrap=false&presets=&prettier=false...
babel/babel
16,110
babel__babel-16110
[ "16106" ]
ff3481746a830e0e94626de4c4cb075ea5f2f5dc
diff --git a/babel.config.js b/babel.config.js --- a/babel.config.js +++ b/babel.config.js @@ -1,12 +1,13 @@ "use strict"; -if ( - typeof it === "function" && +let jestSnapshot = false; +if (typeof it === "function") { // Jest loads the Babel config to parse file and update inline snapshots. // This is ok, as...
diff --git a/packages/babel-generator/test/fixtures/comments/variable-declarator-trailing-comment/output.js b/packages/babel-generator/test/fixtures/comments/variable-declarator-trailing-comment/output.js --- a/packages/babel-generator/test/fixtures/comments/variable-declarator-trailing-comment/output.js +++ b/packages...
[Bug]: duplicated comment after `path.remove()` ### 💻 - [ ] Would you like to work on a fix? ### How are you using Babel? Duplicated comments occurs after using `path.remove()` ### Input code ```js import {parse} from '@babel/parser'; import traverse from '@babel/traverse'; const ast = parse(` ...
Hey @coderaiser! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript question...
2023-11-19T02:29:29Z
7.23
[ "packages/babel-generator/test/arrow-functions.js", "packages/babel-traverse/test/traverse.js", "packages/babel-traverse/test/hub.js", "packages/babel-traverse/test/family.js", "packages/babel-generator/test/printer.skip-bundled.js", "packages/babel-traverse/test/introspection.js", "packages/babel-trave...
[ "packages/babel-traverse/test/removal.js", "packages/babel-traverse/test/index.js", "packages/babel-generator/test/index.js", "packages/babel-plugin-transform-typescript/test/index.js", "packages/babel-plugin-transform-modules-commonjs/test/index.js", "packages/babel-plugin-transform-parameters/test/index...
TypeScript
[]
[ "https://babeljs.io/docs/babel-generator" ]
babel/babel
16,123
babel__babel-16123
[ "16121" ]
c5f0a56063e0c6143f036ed700a38621b811d9d7
diff --git a/packages/babel-helper-create-class-features-plugin/src/decorators.ts b/packages/babel-helper-create-class-features-plugin/src/decorators.ts --- a/packages/babel-helper-create-class-features-plugin/src/decorators.ts +++ b/packages/babel-helper-create-class-features-plugin/src/decorators.ts @@ -213,7 +213,11...
diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/public/derived-super-in-default-params-complex/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/public/derived-super-in-default-params-complex/output.js --- a/packages/babel-plugin-transform-class-properties/test/fixtu...
[Bug]: super operator call using ternary operator ### 💻 - [ ] Would you like to work on a fix? ### How are you using Babel? @babel/cli ### Input code 7.20.15 - [Babel REPL](https://babel.dev/repl#?browsers=defaults%2C%20not%20ie%2011%2C%20not%20ie_mob%2011&build=&builtIns=false&corejs=false&spec=false&l...
Hey @simakvladimir! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript quest...
2023-11-24T17:33:33Z
7.23
[]
[ "packages/babel-plugin-transform-class-properties/test/index.js" ]
TypeScript
[]
[ "https://babel.dev/repl#?browsers=defaults%2C%20not%20ie%2011%2C%20not%20ie_mob%2011&build=&builtIns=false&corejs=false&spec=false&loose=false&code_lz=G4QwTgBASgrgNgUwMIHsB2AXBAPDEC8EAxnCAM5kQDeEAUBBAJZrAoDWzA5gMoYhYBuesXRkMYGEQwowACgAO4BJgA0TFuy69-CAJTVhDDAAtGZAHSKwyvISs2IAfkcQ08OEIZHTF5qw5oPHxYBOr-WsEITi4AtACMnhA...
babel/babel
16,130
babel__babel-16130
[ "16128" ]
1c76c82904c91d040878bdb6ef4a3462694f4b6e
diff --git a/packages/babel-helpers/src/index.ts b/packages/babel-helpers/src/index.ts --- a/packages/babel-helpers/src/index.ts +++ b/packages/babel-helpers/src/index.ts @@ -191,6 +191,7 @@ function permuteHelperAST( const toRename: Record<string, string> = {}; const bindings = new Set(localBindings || []); + ...
diff --git a/packages/babel-helpers/test/fixtures/regression/9496/input.js b/packages/babel-helpers/test/fixtures/misc/9496/input.js similarity index 100% rename from packages/babel-helpers/test/fixtures/regression/9496/input.js rename to packages/babel-helpers/test/fixtures/misc/9496/input.js diff --git a/packages/bab...
[Bug]: `transform-classes` and `transform-object-super` plugins produce code which stack overflow if var named `set` in source code ### 💻 - [ ] Would you like to work on a fix? ### How are you using Babel? Programmatic API (`babel.transform`, `babel.parse`) ### Input code ```js let set; class C { foo() { ...
Hey @overlookmotel! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript quest...
2023-11-27T15:27:11Z
7.23
[]
[ "packages/babel-helpers/test/index.js" ]
TypeScript
[]
[ "https://babeljs.io/repl#?browsers=defaults%2C%20not%20ie%2011%2C%20not%20ie_mob%2011&build=&builtIns=false&corejs=3.21&spec=false&loose=false&code_lz=DYUwLgBAzuDcBQBjYBDKUIGEIG94QgDMB7YgCgEpd8DoBXABxACcA6AIxWYgF4IBGBAQC-8UUA&debug=false&forceAllTransforms=false&modules=false&shippedProposals=false&circleciRepo=&ev...
babel/babel
16,135
babel__babel-16135
[ "15982" ]
750547545585837f5dbe792705415ada42c68658
diff --git a/packages/babel-plugin-transform-classes/src/transformClass.ts b/packages/babel-plugin-transform-classes/src/transformClass.ts --- a/packages/babel-plugin-transform-classes/src/transformClass.ts +++ b/packages/babel-plugin-transform-classes/src/transformClass.ts @@ -214,7 +214,7 @@ export default function t...
diff --git a/packages/babel-plugin-transform-classes/test/fixtures/misc/missing-class-properties-transform-private/input.js b/packages/babel-plugin-transform-classes/test/fixtures/misc/missing-class-properties-transform-private/input.js new file mode 100644 --- /dev/null +++ b/packages/babel-plugin-transform-classes/te...
[Bug]: Class Private field throws error "Module parse failed: Private field '#key' must be declared in an enclosing class" ### 💻 - [ ] Would you like to work on a fix? ### How are you using Babel? babel-loader (webpack) ### Input code ```javascript class Test { #key = ''; constructor() {} ...
Hey @gaebalgombal! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questi...
2023-11-28T14:08:25Z
7.23
[]
[ "packages/babel-plugin-transform-classes/test/index.js" ]
TypeScript
[]
[]
babel/babel
16,137
babel__babel-16137
[ "16134", "16133" ]
a31c4b9152c29b4c6b1efa3bc20f3a3124f54ec7
diff --git a/packages/babel-plugin-transform-typescript/src/enum.ts b/packages/babel-plugin-transform-typescript/src/enum.ts --- a/packages/babel-plugin-transform-typescript/src/enum.ts +++ b/packages/babel-plugin-transform-typescript/src/enum.ts @@ -155,7 +155,9 @@ const enumSelfReferenceVisitor = { }; export func...
diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/enum/enum-merging-inner-references-shadow/input.ts b/packages/babel-plugin-transform-typescript/test/fixtures/enum/enum-merging-inner-references-shadow/input.ts new file mode 100644 --- /dev/null +++ b/packages/babel-plugin-transform-typescript/test/...
[Bug]: Wrong refrences of merging enum ### 💻 - [ ] Would you like to work on a fix? ### How are you using Babel? Programmatic API (`babel.transform`, `babel.parse`) ### Input code ```TypeScript const Cat = 10; const Dog = 20; enum Animals { Cat = 1 } enum Animals { Dog = 2 } enum Animals { CatD...
Hey @magic-akari! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questio...
2023-11-28T15:29:47Z
7.23
[]
[ "packages/babel-plugin-transform-typescript/test/index.js" ]
TypeScript
[]
[ "https://babeljs.io/repl#?browsers=defaults%2C%20not%20ie%2011%2C%20not%20ie_mob%2011&build=&builtIns=false&corejs=3.21&spec=false&loose=false&code_lz=KYOwrgtgBAgiCWECGAbAzlA3gKAJAGEkAXKAXigEZsBfbbUSWBZdLPAEQHsBzMqAJhp0G0OIlQYcBYl17kohEgFoosoUA&debug=false&forceAllTransforms=false&modules=false&shippedProposals=fal...
babel/babel
16,180
babel__babel-16180
[ "16179" ]
328489729b3d39a1497bfe22b6be15507e0df640
diff --git a/packages/babel-helpers/src/helpers-generated.ts b/packages/babel-helpers/src/helpers-generated.ts --- a/packages/babel-helpers/src/helpers-generated.ts +++ b/packages/babel-helpers/src/helpers-generated.ts @@ -43,10 +43,10 @@ export default Object.freeze({ "7.21.0", 'import checkInRHS from"checkI...
diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/ctx/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/ctx/exec.js new file mode 100644 --- /dev/null +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--t...
[Bug]: class decorator context.kind is 'field', should 'class' ### 💻 - [ ] Would you like to work on a fix? ### How are you using Babel? @rollup/plugin-babel ### Input code ```js @DecTest class Test {} function DecTest(value, ctx) { console.log(ctx.kind, ctx, value); } ``` ### Configuration file name ...
Hey @liuzw2579! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions...
2023-12-15T03:41:11Z
7.23
[]
[ "packages/babel-plugin-proposal-decorators/test/index.js" ]
TypeScript
[]
[]
babel/babel
16,199
babel__babel-16199
[ "16198" ]
bc503ccab7c4052ccef80b2981eb98af22467e4e
diff --git a/packages/babel-helpers/src/helpers-generated.ts b/packages/babel-helpers/src/helpers-generated.ts --- a/packages/babel-helpers/src/helpers-generated.ts +++ b/packages/babel-helpers/src/helpers-generated.ts @@ -43,10 +43,10 @@ export default Object.freeze({ "7.21.0", 'import checkInRHS from"checkI...
diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/decorator-access-modified-classes/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/decorator-access-modified-classes/exec.js new file mode 100644 --- /dev/null +++ b/packages/babel...
[Bug]: decorators are broken and when applied, they override the preceding value. ### 💻 - [ ] Would you like to work on a fix? ### How are you using Babel? @babel/cli ### Input code I've created a test repo with a basic example [here](https://github.com/amirmohsen/decorators-broken). You can also see it below: `...
Hey @amirmohsen! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript question...
2023-12-30T10:55:41Z
7.23
[]
[ "packages/babel-plugin-proposal-decorators/test/index.js" ]
TypeScript
[]
[]
babel/babel
16,235
babel__babel-16235
[ "16188" ]
2249bb4b288ed38224d278b5f6a2695068163c00
diff --git a/packages/babel-helper-create-class-features-plugin/src/decorators.ts b/packages/babel-helper-create-class-features-plugin/src/decorators.ts --- a/packages/babel-helper-create-class-features-plugin/src/decorators.ts +++ b/packages/babel-helper-create-class-features-plugin/src/decorators.ts @@ -1138,20 +1138...
diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/private/output.js --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/private/output...
[Bug]: decorators 2023-05: `addInitializer` runs initializer at the wrong time ### 💻 - [ ] Would you like to work on a fix? ### How are you using Babel? @babel/cli ### Input code ```js class Example { #foo = 123 @deco set foo(v) {this.#foo = v} get foo() { return this.#foo } } functio...
Hey @trusktr! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, ...
2024-01-25T16:34:03Z
7.23
[]
[ "packages/babel-plugin-proposal-decorators/test/index.js" ]
TypeScript
[]
[ "https://babeljs.io/repl#?browsers=chrome%20117&build=&builtIns=false&corejs=3.21&spec=false&loose=false&code_lz=MYGwhgzhAECiAeYC2AHEBTaBvAUNaAxAGYD2J0AvNAIwBMAzDntAAIAm6wJzE6ALtFIkAFADcAlNj4ALAJYQAdMTKVoogL7MA5v0FlhkrNABO_AK7GAdtBnylQ6Js04iZy8D6yS1jl2EB9ABpoLks-dHg-Q2ZQ8MiFMDY2AElLWU8wEFkAL3RjYVd3T29oA2xmfAB6Suhko...
babel/babel
16,241
babel__babel-16241
[ "16238" ]
5cced523dab5483f13fc10b4fe2e7dee791eee47
diff --git a/packages/babel-plugin-transform-runtime/src/index.ts b/packages/babel-plugin-transform-runtime/src/index.ts --- a/packages/babel-plugin-transform-runtime/src/index.ts +++ b/packages/babel-plugin-transform-runtime/src/index.ts @@ -14,6 +14,7 @@ export interface Options { corejs?: string | number | { vers...
diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/moduleName/custom/input.js b/packages/babel-plugin-transform-runtime/test/fixtures/moduleName/custom/input.js new file mode 100644 --- /dev/null +++ b/packages/babel-plugin-transform-runtime/test/fixtures/moduleName/custom/input.js @@ -0,0 +1 @@ +class ...
[Bug]: Error: Can't resolve '@babel/runtime-corejs3/helpers/asyncToGenerator' ### 💻 - [ ] Would you like to work on a fix? ### How are you using Babel? babel-loader (webpack) ### Input code ```js export const myAsync = async () => { } ``` ### Configuration file name babel.config.js ### Confi...
2024-01-26T18:51:49Z
7.23
[ "packages/babel-plugin-transform-runtime/test/regression.js" ]
[ "packages/babel-plugin-transform-runtime/test/index.js" ]
TypeScript
[]
[]
babel/babel
16,277
babel__babel-16277
[ "16276" ]
19c54cf690afe9d62e1dba8e6ee7d92bbe43451f
diff --git a/packages/babel-parser/src/plugins/typescript/index.ts b/packages/babel-parser/src/plugins/typescript/index.ts --- a/packages/babel-parser/src/plugins/typescript/index.ts +++ b/packages/babel-parser/src/plugins/typescript/index.ts @@ -566,6 +566,19 @@ export default (superClass: ClassWithMixin<typeof Parser...
diff --git a/packages/babel-parser/test/fixtures/typescript/types/import-type-dynamic-with-jsx-options/input.ts b/packages/babel-parser/test/fixtures/typescript/types/import-type-dynamic-with-jsx-options/input.ts new file mode 100644 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/types/import-type-d...
[Bug]: should parse `type A = import("mod", { with: { type: "json" }});` ### 💻 - [X] Would you like to work on a fix? ### How are you using Babel? Programmatic API (`babel.transform`, `babel.parse`) ### Input code ```ts type A = import("foo", {with: {type: "json"}}) ``` ### Configuration file name _No respons...
2024-02-12T11:16:48Z
7.23
[ "packages/babel-parser/test/unit/util/identifier.skip-bundled.js", "packages/babel-parser/test/unit/tokenizer/types.skip-bundled.js", "packages/babel-parser/test/commonjs.bundled.js", "packages/babel-parser/test/error-codes.js", "packages/babel-parser/test/plugin-options.js", "packages/babel-parser/test/o...
[ "packages/babel-parser/test/index.js", "packages/babel-parser/test/estree-throws.js" ]
TypeScript
[]
[ "https://www.typescriptlang.org/play?#code/C4TwDgpgBAglC8UCWBbMB7ATsAFAIgDN108AaKAbwHclgALALktEibwCsBndAOzwF9+ASgBQQA" ]
babel/babel
16,350
babel__babel-16350
[ "16341" ]
dc891b650a30a99cf37cd4ac0ead0f519d7ce0f7
diff --git a/packages/babel-helper-create-class-features-plugin/src/decorators.ts b/packages/babel-helper-create-class-features-plugin/src/decorators.ts --- a/packages/babel-helper-create-class-features-plugin/src/decorators.ts +++ b/packages/babel-helper-create-class-features-plugin/src/decorators.ts @@ -1219,6 +1219,...
diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-classes--to-es2015/replacement-static-private-environment-super/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-classes--to-es2015/replacement-static-private-environment-super/exec.js --- a/packages/babel-plugin-propo...
[Bug]: Incorrect computed key evaluation order when a class has only class decorators ### 💻 - [X] Would you like to work on a fix? ### How are you using Babel? Programmatic API (`babel.transform`, `babel.parse`) ### Input code ```js const dummy = () => {} const logs = []; @dummy class C { [(logs.push(1...
Hey @JLHwung! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, ...
2024-03-13T15:32:58Z
7.24
[]
[ "packages/babel-plugin-proposal-decorators/test/index.js" ]
TypeScript
[]
[ "https://babel.dev/repl#?browsers=chrome%2032&build=&builtIns=false&corejs=3.21&spec=false&loose=true&code_lz=MYewdgzgLgBAJgVwLZIJ4wLwwBQEpMB8MA3gL4BQ5oksANiAOYSYwDaAugNyUACiKqKrQCGEZgGES5GG2z0mAOgAOCCAAtsARlwAaGNq7SY0YVACWwWfIjLVGgEy6YjwzNZzGNleuwBmJ_6GFFTgECC0AKYK8h5MuJxAA&debug=false&forceAllTransforms=false&mod...
babel/babel
16,368
babel__babel-16368
[ "16367" ]
fb7cf6343704731802c2dac18999990d7d4ce484
diff --git a/packages/babel-plugin-transform-block-scoping/src/index.ts b/packages/babel-plugin-transform-block-scoping/src/index.ts --- a/packages/babel-plugin-transform-block-scoping/src/index.ts +++ b/packages/babel-plugin-transform-block-scoping/src/index.ts @@ -57,12 +57,11 @@ export default declare((api, opts: Op...
diff --git a/packages/babel-plugin-transform-block-scoping/test/fixtures/general/for-without-block/exec.js b/packages/babel-plugin-transform-block-scoping/test/fixtures/general/for-without-block/exec.js new file mode 100644 --- /dev/null +++ b/packages/babel-plugin-transform-block-scoping/test/fixtures/general/for-with...
[Bug]: local let variable is not captured in for..in loop ### 💻 - [ ] Would you like to work on a fix? ### How are you using Babel? babel-loader (webpack) ### Input code ```js function proxyObserver(component) { for (let key in component.properties) if (component.properties[key].observer) { ...
Hey @ele828! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, w...
2024-03-20T05:50:38Z
7.24
[]
[ "packages/babel-plugin-transform-block-scoping/test/index.js" ]
TypeScript
[]
[]
babel/babel
16,377
babel__babel-16377
[ "16375" ]
87ec4fc3d2cf44c30ef007f7da47d7177e07ffec
diff --git a/packages/babel-traverse/src/scope/index.ts b/packages/babel-traverse/src/scope/index.ts --- a/packages/babel-traverse/src/scope/index.ts +++ b/packages/babel-traverse/src/scope/index.ts @@ -372,6 +372,9 @@ const collectorVisitor: Visitor<CollectVisitorState> = { path.scope.registerBinding("local", p...
diff --git a/packages/babel-plugin-transform-classes/test/fixtures/misc/function-name-ts-annotation/input.ts b/packages/babel-plugin-transform-classes/test/fixtures/misc/function-name-ts-annotation/input.ts new file mode 100644 --- /dev/null +++ b/packages/babel-plugin-transform-classes/test/fixtures/misc/function-name...
[Bug]: TypeScript annotation that contains the name of the annotated class method changes final output ### Input code [REPL link](https://babeljs.io/repl#?browsers=defaults%2C%20not%20ie%2011%2C%20not%20ie_mob%2011&build=&builtIns=false&corejs=3.21&spec=false&loose=true&code_lz=KYDwDg9gTgLgBAYwDYEMDOa4BEUxQI3WDgG8Ao...
Hey @aweary! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, w...
2024-03-22T18:06:09Z
7.24
[]
[ "packages/babel-plugin-transform-classes/test/index.js" ]
TypeScript
[]
[ "https://babeljs.io/repl#?browsers=defaults%2C%20not%20ie%2011%2C%20not%20ie_mob%2011&build=&builtIns=false&corejs=3.21&spec=false&loose=true&code_lz=KYDwDg9gTgLgBAYwDYEMDOa4BEUxQI3WDgG8AoOOGKFAOzRQRgEsJaAKCyuAeh7gCSAMyoALYjACeYYnVoQ8LNnHFRiCNnmb0xxAFS0UAW2IQRMcXBMWIAEz1dKfXbTjN4CUXQDmwTKIgAd10rYBtbN0wNIzBmJGBbADo4...
babel/babel
16,384
babel__babel-16384
[ "16382" ]
acf3d17fdfe150a270c822581b709dddac4548ce
diff --git a/packages/babel-plugin-transform-block-scoping/src/loop.ts b/packages/babel-plugin-transform-block-scoping/src/loop.ts --- a/packages/babel-plugin-transform-block-scoping/src/loop.ts +++ b/packages/babel-plugin-transform-block-scoping/src/loop.ts @@ -239,17 +239,13 @@ export function wrapLoopBody( va...
diff --git a/packages/babel-plugin-transform-block-scoping/test/fixtures/general/for-inside-for-x/input.js b/packages/babel-plugin-transform-block-scoping/test/fixtures/general/for-inside-for-x/input.js new file mode 100644 --- /dev/null +++ b/packages/babel-plugin-transform-block-scoping/test/fixtures/general/for-insi...
[Bug]: Transform block scoping fails with for in statement inside loop ### 💻 - [ ] Would you like to work on a fix? ### How are you using Babel? Programmatic API (`babel.transform`, `babel.parse`) ### Input code I was able to replicate this issue in babeljs.io with the following code: ```js function w() { ...
Hey @luiscubal! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions...
2024-03-25T16:29:25Z
7.24
[]
[ "packages/babel-plugin-transform-block-scoping/test/index.js" ]
TypeScript
[]
[]
babel/babel
16,385
babel__babel-16385
[ "16383" ]
acf3d17fdfe150a270c822581b709dddac4548ce
diff --git a/packages/babel-helper-create-class-features-plugin/src/decorators.ts b/packages/babel-helper-create-class-features-plugin/src/decorators.ts --- a/packages/babel-helper-create-class-features-plugin/src/decorators.ts +++ b/packages/babel-helper-create-class-features-plugin/src/decorators.ts @@ -475,26 +475,2...
diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc--to-es2015/initField-existing-derived-constructor/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc--to-es2015/initField-existing-derived-constructor/exec.js new file mode 100644 --- /dev/null +++ b/packages/b...
[Bug]: Decorators | Error when calling `super` in constructor of extended class when decorating accessors. ### 💻 - [ ] Would you like to work on a fix? ### How are you using Babel? @babel/register or @babel/node ### Input code [Babel REPL Repro](https://babeljs.io/repl#?browsers=es2022&build=&builtIns=false&corej...
Hey @jkonowitch! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript question...
2024-03-25T18:26:00Z
7.24
[]
[ "packages/babel-plugin-proposal-decorators/test/index.js" ]
TypeScript
[]
[ "https://babeljs.io/repl#?browsers=es2022&build=&builtIns=false&corejs=3.21&spec=false&loose=false&code_lz=GYVwdgxgLglg9mABAEwKYTgJwIZVQCgEpEBvAKEUU1ShEyVElgUXym0wHMaAaRDMHgAeUYiQC-ZSWQgAbbAGcFiACqoFUUhUQABNBhx4i27BAjqFWRMDhxEAXkQAWAEwBuMtoEbMIaFiItSgBIbzhZVAA6WThOfAByAAtUWRj4wg9KSWkwVAB3VXUoYxl5JUKNAGFEmFlkRFQRVDB...
babel/babel
16,394
babel__babel-16394
[ "16393" ]
efcc01cbe65325386dc9f5ae27260f517ee229aa
diff --git a/packages/babel-generator/src/generators/typescript.ts b/packages/babel-generator/src/generators/typescript.ts --- a/packages/babel-generator/src/generators/typescript.ts +++ b/packages/babel-generator/src/generators/typescript.ts @@ -414,7 +414,7 @@ export function TSIndexedAccessType( } export functio...
diff --git a/packages/babel-generator/test/fixtures/typescript/mapped-type/input.ts b/packages/babel-generator/test/fixtures/typescript/mapped-type/input.ts new file mode 100644 --- /dev/null +++ b/packages/babel-generator/test/fixtures/typescript/mapped-type/input.ts @@ -0,0 +1 @@ +type Bar = { [key in Foo] }; diff --...
[Bug]: Typescript mapped type with implicit any results in faulty TS ### 💻 - [ ] Would you like to work on a fix? ### How are you using Babel? Programmatic API (`babel.transform`, `babel.parse`) ### Input code ```ts type Bar = { [key in Foo] }; ``` ### Configuration file name _No response_ ### Configuration ...
Hey @aczekajski! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript question...
2024-03-29T07:34:43Z
7.24
[ "packages/babel-generator/test/printer.skip-bundled.js", "packages/babel-generator/test/arrow-functions.js" ]
[ "packages/babel-generator/test/index.js" ]
TypeScript
[]
[]
babel/babel
16,440
babel__babel-16440
[ "16435" ]
a8994f8b7d421dd17b076c2557c9d5bd0e3faef1
diff --git a/packages/babel-helpers/src/helpers-generated.ts b/packages/babel-helpers/src/helpers-generated.ts --- a/packages/babel-helpers/src/helpers-generated.ts +++ b/packages/babel-helpers/src/helpers-generated.ts @@ -191,7 +191,7 @@ export default Object.freeze({ // size: 922, gzip size: 481 usingCtx: helpe...
diff --git a/packages/babel-plugin-proposal-explicit-resource-management/test/fixtures/exec-async/async-dispose-throws-synchronously.js b/packages/babel-plugin-proposal-explicit-resource-management/test/fixtures/exec-async/async-dispose-throws-synchronously.js --- a/packages/babel-plugin-proposal-explicit-resource-mana...
[Bug]: babel compile `proposal-explicit-resource-management` different from `tsc` ### 💻 - [ ] Would you like to work on a fix? ### How are you using Babel? @babel/cli ### Input code https://github.com/microsoft/TypeScript/issues/58234 ```js import { deepStrictEqual } from 'node:assert' import proce...
Hey @loynoir! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, ...
2024-04-20T07:13:03Z
7.24
[]
[ "packages/babel-plugin-proposal-explicit-resource-management/test/index.js" ]
TypeScript
[]
[]
babel/babel
16,476
babel__babel-16476
[ "16465" ]
9c77558234c87b9220604fbc1519089e2d6334e2
diff --git a/packages/babel-parser/src/plugins/typescript/index.ts b/packages/babel-parser/src/plugins/typescript/index.ts --- a/packages/babel-parser/src/plugins/typescript/index.ts +++ b/packages/babel-parser/src/plugins/typescript/index.ts @@ -3708,6 +3708,7 @@ export default (superClass: ClassWithMixin<typeof Parse...
diff --git a/packages/babel-parser/test/fixtures/typescript/assign/TSTypeParameterInstantiation-babel-7/input.ts b/packages/babel-parser/test/fixtures/typescript/assign/TSTypeParameterInstantiation-babel-7/input.ts new file mode 100644 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/assign/TSTypePara...
[Bug]: Error parsing TypeScript generics on left-hand side ### 💻 - [ ] Would you like to work on a fix? ### How are you using Babel? @babel/cli ### Input code [REPL link](https://babel.dev/repl#?browsers=defaults%2C%20not%20ie%2011%2C%20not%20ie_mob%2011&build=&builtIns=false&corejs=3.21&spec=false&loos...
Hey @mtdavis! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, ...
2024-05-05T01:43:09Z
7.24
[ "packages/babel-parser/test/unit/util/identifier.skip-bundled.js", "packages/babel-parser/test/commonjs.bundled.js", "packages/babel-parser/test/unit/tokenizer/types.skip-bundled.js", "packages/babel-parser/test/error-codes.js", "packages/babel-parser/test/attachComment-false.js", "packages/babel-parser/t...
[ "packages/babel-plugin-transform-typescript/test/index.js", "packages/babel-parser/test/index.js", "packages/babel-parser/test/estree-throws.js" ]
TypeScript
[]
[ "https://babel.dev/repl#?browsers=defaults%2C%20not%20ie%2011%2C%20not%20ie_mob%2011&build=&builtIns=false&corejs=3.21&spec=false&loose=false&code_lz=KYDwDg9gTgLgBAQwEYGcZQQY3pgNglFOAQVXSxgGF9C4BvAKDmbjAFclcBLTONBGDzgBbAJ4AxNgDtMAfgBccADwBZOKBjApAEyKk0GbNQIoAfAAomLazAAWXFIv3kjNFABor15lyn8ZwIoqntYAlHAAvKZwAG4QXNoA3A...
babel/babel
16,484
babel__babel-16484
[ "16481" ]
4bd1b2c2f1bb3f702cfcb50448736e33c7000128
diff --git a/packages/babel-helper-create-class-features-plugin/src/decorators.ts b/packages/babel-helper-create-class-features-plugin/src/decorators.ts --- a/packages/babel-helper-create-class-features-plugin/src/decorators.ts +++ b/packages/babel-helper-create-class-features-plugin/src/decorators.ts @@ -664,13 +664,1...
diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc/decorator-evaluation-new-target/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc/decorator-evaluation-new-target/exec.js --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc/decorator-ev...
[Bug]: Await in a class decorator is not properly transpiled ### 💻 - [ ] Would you like to work on a fix? ### How are you using Babel? Other (Next.js, Gatsby, vue-cli, ...) ### Input code ```js @(await 1) class A {} ``` ### Configuration file name _No response_ ### Configuration decorators plugin on lates...
2024-05-09T17:25:41Z
7.24
[]
[ "packages/babel-plugin-proposal-decorators/test/index.js" ]
TypeScript
[]
[]
babel/babel
16,524
babel__babel-16524
[ "16422" ]
9b3667a831d87180e9215faa26f0a702a8a5f61f
diff --git a/packages/babel-helper-transform-fixture-test-runner/src/index.ts b/packages/babel-helper-transform-fixture-test-runner/src/index.ts --- a/packages/babel-helper-transform-fixture-test-runner/src/index.ts +++ b/packages/babel-helper-transform-fixture-test-runner/src/index.ts @@ -428,6 +428,8 @@ async functio...
diff --git a/packages/babel-plugin-proposal-explicit-resource-management/test/fixtures/source-maps/switch/input.js b/packages/babel-plugin-proposal-explicit-resource-management/test/fixtures/source-maps/switch/input.js new file mode 100644 --- /dev/null +++ b/packages/babel-plugin-proposal-explicit-resource-management/...
[Bug]: `using` in `switch` is not compiled ### 💻 - [ ] Would you like to work on a fix? ### How are you using Babel? Other (Next.js, Gatsby, vue-cli, ...) ### Input code ```js { switch (1) { case 1: using a = 1; case 2: using b = 2; } using c = 4; } ``` https://babeljs.io/re...
2024-05-22T13:20:31Z
7.24
[]
[ "packages/babel-plugin-proposal-explicit-resource-management/test/index.js" ]
TypeScript
[]
[ "https://babeljs.io/repl#?browsers=&build=&builtIns=false&corejs=3.21&spec=false&loose=false&code_lz=N4KABGDODuCWAuBjAFmAFARgJRlBCiAhpAKZgYBc4-EArpLAHYDmYhYAvOQNzUHFkATFRp0GLMACNOYQbwgBfavSatEMgCy8FQA&debug=false&forceAllTransforms=false&modules=commonjs&shippedProposals=false&circleciRepo=&evaluate=true&fileSize=f...
babel/babel
16,554
babel__babel-16554
[ "16553" ]
4463aa5744545e9c74a987c881a366d27c6d7138
diff --git a/packages/babel-node/src/_babel-node.ts b/packages/babel-node/src/_babel-node.ts --- a/packages/babel-node/src/_babel-node.ts +++ b/packages/babel-node/src/_babel-node.ts @@ -71,6 +71,8 @@ program.option( program.option("-w, --plugins [string]", "", collect); program.option("-b, --presets [string]", "", c...
diff --git a/packages/babel-node/test/fixtures/cli/extra-flags/in-files/bar.js b/packages/babel-node/test/fixtures/cli/extra-flags/in-files/bar.js new file mode 100644 --- /dev/null +++ b/packages/babel-node/test/fixtures/cli/extra-flags/in-files/bar.js @@ -0,0 +1 @@ +console.log(process.argv.slice(2)); diff --git a/pa...
[Bug]: error "unknown option" raised when using @babel/node as CLI ### 💻 - [ ] Would you like to work on a fix? ### How are you using Babel? @babel/register or @babel/node ### Input code Since the latest version of `@babel/node` I can no longer use custom args in CLI. I guess it's related to the commander update....
Hey @j0k3r! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, we...
2024-06-05T09:30:55Z
7.24
[ "packages/babel-node/test/batch-test-runner/7.js", "packages/babel-node/test/batch-test-runner/6.js", "packages/babel-node/test/batch-test-runner/2.js", "packages/babel-node/test/batch-test-runner/1.js", "packages/babel-node/test/batch-test-runner/4.js", "packages/babel-node/test/batch-test-runner/5.js", ...
[ "packages/babel-node/test/batch-test-runner/3.js" ]
TypeScript
[]
[]
babel/babel
16,566
babel__babel-16566
[ "16565" ]
1c89c4ed33c6e5cf1e2c1472a5e4ee7d6c78cfda
diff --git a/packages/babel-plugin-transform-typescript/src/index.ts b/packages/babel-plugin-transform-typescript/src/index.ts --- a/packages/babel-plugin-transform-typescript/src/index.ts +++ b/packages/babel-plugin-transform-typescript/src/index.ts @@ -604,7 +604,7 @@ export default declare((api, opts: Options) => { ...
diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/exports/export-import=/input.ts b/packages/babel-plugin-transform-typescript/test/fixtures/exports/export-import=/input.ts new file mode 100644 --- /dev/null +++ b/packages/babel-plugin-transform-typescript/test/fixtures/exports/export-import=/input....
[Bug]: export import does not export in Babel (works in TypeScript) ### 💻 - [ ] Would you like to work on a fix? ### How are you using Babel? babel-loader (webpack) ### Input code TypeScript code ```js import * as joint from '@joint/core'; export import JGraph = joint.dia.Graph; ``` ### Configuration fil...
Hey @tomasbruckner! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript quest...
2024-06-07T13:28:00Z
7.24
[]
[ "packages/babel-plugin-transform-typescript/test/index.js" ]
TypeScript
[]
[ "https://babeljs.io/repl", "https://www.typescriptlang.org/play/" ]
babel/babel
16,567
babel__babel-16567
[ "16542" ]
1c89c4ed33c6e5cf1e2c1472a5e4ee7d6c78cfda
diff --git a/packages/babel-parser/src/plugins/typescript/index.ts b/packages/babel-parser/src/plugins/typescript/index.ts --- a/packages/babel-parser/src/plugins/typescript/index.ts +++ b/packages/babel-parser/src/plugins/typescript/index.ts @@ -3905,12 +3905,15 @@ export default (superClass: ClassWithMixin<typeof Par...
diff --git a/packages/babel-parser/test/fixtures/typescript/declare/eval-dts/input.ts b/packages/babel-parser/test/fixtures/typescript/declare/eval-dts/input.ts new file mode 100644 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/declare/eval-dts/input.ts @@ -0,0 +1,12 @@ +// @filename: /a.d.ts +decl...
Error when parsing `eval` in `.d.ts` This should not throw an error. ```ts // @filename: /a.d.ts declare global { export namespace ns { export function eval(): void; export function arguments(): void; } } declare function eval(): void; declare function arguments(): void; export ...
Oh! This is not a bug, this is a change introduced in ts 5.5.
2024-06-08T08:27:12Z
7.24
[ "packages/babel-parser/test/error-codes.js", "packages/babel-parser/test/unit/util/identifier.skip-bundled.js", "packages/babel-parser/test/commonjs.bundled.js", "packages/babel-parser/test/plugin-options.js", "packages/babel-parser/test/unit/tokenizer/types.skip-bundled.js", "packages/babel-parser/test/o...
[ "packages/babel-parser/test/index.js", "packages/babel-parser/test/estree-throws.js" ]
TypeScript
[]
[]
babel/babel
16,579
babel__babel-16579
[ "16534" ]
da0b8551e21d6cfdcf02fdc9655c392cc25f5916
diff --git a/packages/babel-helper-import-to-platform-api/src/index.ts b/packages/babel-helper-import-to-platform-api/src/index.ts --- a/packages/babel-helper-import-to-platform-api/src/index.ts +++ b/packages/babel-helper-import-to-platform-api/src/index.ts @@ -9,6 +9,7 @@ function imp(path: NodePath, name: string, mo...
diff --git a/packages/babel-plugin-proposal-json-modules/test/fixtures/browser-cjs/import-declaration-multiple/input.js b/packages/babel-plugin-proposal-json-modules/test/fixtures/browser-cjs/import-declaration-multiple/input.js new file mode 100644 --- /dev/null +++ b/packages/babel-plugin-proposal-json-modules/test/f...
[Bug]: `@babel/plugin-proposal-json-module` may output some ESM code (or even call `undefined` as if it's a function) to CJS outputs ### 💻 - [ ] Would you like to work on a fix? ### How are you using Babel? @rollup/plugin-babel ### Input code https://babel.dev/repl#?browsers=&build=&builtIns=false&corejs=false&sp...
Hey @BinToss! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, ...
2024-06-20T11:39:12Z
7.24
[]
[ "packages/babel-plugin-proposal-json-modules/test/index.js" ]
TypeScript
[]
[ "https://babel.dev/repl#?browsers=&build=&builtIns=false&corejs=false&spec=false&loose=false&code_lz=JYWwDg9gTgLgBAcwDYQEYEMkGc4DMoQhwBEyamWA9GRtgHQBWWEAdsXAO7AwAWcA3jACeYAKYAuEk1bEAvgCh5ogB6RYcACajc6AK5J4NCkA&debug=false&forceAllTransforms=false&modules=commonjs&shippedProposals=false&circleciRepo=&evaluate=true&f...
babel/babel
16,587
babel__babel-16587
[ "16583" ]
7a27ff45fa1a5b8eb29e9ae4df9db0a97252ac04
diff --git a/packages/babel-traverse/src/path/removal.ts b/packages/babel-traverse/src/path/removal.ts --- a/packages/babel-traverse/src/path/removal.ts +++ b/packages/babel-traverse/src/path/removal.ts @@ -11,15 +11,16 @@ export function remove(this: NodePath) { _assertUnremoved.call(this); this.resync(); - i...
diff --git a/packages/babel-traverse/test/fixtures/scope/remove-nested-let-path/input.js b/packages/babel-traverse/test/fixtures/scope/remove-nested-let-path/input.js new file mode 100644 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/scope/remove-nested-let-path/input.js @@ -0,0 +1,4 @@ +{ + let a = 33; +}...
[Bug]: variable declarator remove bug ### 💻 - [x] Would you like to work on a fix? ### How are you using Babel? Programmatic API (`babel.transform`, `babel.parse`) ### Input code ```js // WORKING_DIR_ROOT/test/custom_tests/remove.js const traverse = require("../../packages/babel-traverse/lib").defau...
Hey @nerodesu017! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questio...
2024-06-24T17:07:50Z
7.24
[ "packages/babel-traverse/test/conversion.js", "packages/babel-traverse/test/hub.js", "packages/babel-traverse/test/introspection.js", "packages/babel-traverse/test/removal.js", "packages/babel-traverse/test/path/isPure.js", "packages/babel-traverse/test/family.js", "packages/babel-traverse/test/modifica...
[ "packages/babel-traverse/test/index.js" ]
TypeScript
[]
[]
babel/babel
16,591
babel__babel-16591
[ "16590" ]
909ed3473968c2ccd75f89e17c37ef4771cc3ff8
diff --git a/packages/babel-generator/src/node/parentheses.ts b/packages/babel-generator/src/node/parentheses.ts --- a/packages/babel-generator/src/node/parentheses.ts +++ b/packages/babel-generator/src/node/parentheses.ts @@ -307,7 +307,8 @@ export function YieldExpression( hasPostfixPart(node, parent) || (p...
diff --git a/packages/babel-generator/test/fixtures/typescript/yield-expression-inside-type-expression/input.js b/packages/babel-generator/test/fixtures/typescript/yield-expression-inside-type-expression/input.js new file mode 100644 --- /dev/null +++ b/packages/babel-generator/test/fixtures/typescript/yield-expression...
[Bug]: wrong code generation for yield expressions followed by a type expression ### 💻 - [X] Would you like to work on a fix? ### How are you using Babel? Programmatic API (`babel.transform`, `babel.parse`) ### Input code ```js import { parse } from "@babel/parser"; import generator from "@babel/gener...
Hey @SreeXD! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, w...
2024-06-26T18:47:00Z
7.24
[ "packages/babel-generator/test/arrow-functions.js", "packages/babel-generator/test/printer.skip-bundled.js" ]
[ "packages/babel-generator/test/index.js" ]
TypeScript
[]
[]
iamkun/dayjs
1,003
iamkun__dayjs-1003
[ "1002" ]
6e5ffce3af00df88428ac3634d6a89c985d79217
diff --git a/src/plugin/timezone/index.js b/src/plugin/timezone/index.js --- a/src/plugin/timezone/index.js +++ b/src/plugin/timezone/index.js @@ -7,6 +7,8 @@ const typeToPos = { second: 5 } +const ms = 'ms' + export default (o, c, d) => { const localUtcOffset = d().utcOffset() const tzOffset = (timestamp,...
diff --git a/test/plugin/timezone.test.js b/test/plugin/timezone.test.js --- a/test/plugin/timezone.test.js +++ b/test/plugin/timezone.test.js @@ -56,6 +56,14 @@ describe('Parse', () => { expect(newYork.tz('America/Los_Angeles').format()).toBe('2014-06-01T09:00:00-07:00') expect(newYork.tz('Europe/London').fo...
Changing timezone sets milliseconds to 0 **Describe the bug** ```js let d = dayjs(1596735327399); console.log(d.millisecond()); // Will print 399 d = d.tz('America/New_York'); console.log(d.millisecond()); // Will print 0 ``` **Expected behavior** Milliseconds should be preserved. **Information** - Day.j...
Thanks, Fixed.
2020-08-13T18:14:40Z
1.8
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/timezone.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,008
iamkun__dayjs-1008
[ "1007" ]
5a465cc90c0ace55268b2640512d0a4c6544ac7f
diff --git a/src/plugin/duration/index.js b/src/plugin/duration/index.js --- a/src/plugin/duration/index.js +++ b/src/plugin/duration/index.js @@ -28,7 +28,7 @@ const prettyUnit = unit => `${$u.p(unit)}s` class Duration { constructor(input, unit, locale) { this.$d = {} - this.$l = locale || 'en' + this.$...
diff --git a/test/plugin/duration.test.js b/test/plugin/duration.test.js --- a/test/plugin/duration.test.js +++ b/test/plugin/duration.test.js @@ -101,6 +101,15 @@ describe('Humanize', () => { expect(dayjs.duration(1, 'minutes').locale('fr').humanize(true)).toBe('dans une minute') expect(dayjs.duration(1, 'mi...
dayjs.duration().humanize() international My code: ``` import dayjs from 'dayjs' import duration from 'dayjs/plugin/duration' import relativeTime from 'dayjs/plugin/relativeTime' import localeData from 'dayjs/plugin/localeData' import 'dayjs/locale/zh-cn' dayjs.extend(duration) dayjs.extend(relativeTime) d...
Please use ``` dayjs.duration(24 * 60 * 60 * 1000).locale('zh-cn').humanize() ``` in the current version. Global locale duration support `dayjs.locale('zh-cn')` will be added in the next version.
2020-08-16T03:29:23Z
1.8
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/duration.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,010
iamkun__dayjs-1010
[ "544" ]
5a465cc90c0ace55268b2640512d0a4c6544ac7f
diff --git a/src/constant.js b/src/constant.js --- a/src/constant.js +++ b/src/constant.js @@ -26,5 +26,5 @@ export const FORMAT_DEFAULT = 'YYYY-MM-DDTHH:mm:ssZ' export const INVALID_DATE_STRING = 'Invalid Date' // regex -export const REGEX_PARSE = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?...
diff --git a/test/parse.test.js b/test/parse.test.js --- a/test/parse.test.js +++ b/test/parse.test.js @@ -81,6 +81,14 @@ describe('Parse', () => { expect(normalized.toISOString()).toEqual(expected) }) + it('parses unlimited millisecond', () => { + const date = '2019-03-25T06:41:00.999999999' + const d...
UTC Plugin Milliseconds parsing **Describe the bug** When I use the UTC-Plugin and try to parse a string with milliseconds, it changes the time (I'm CET). If I append a "Z" to my string, this does not happen (see example) **Expected behavior** Parsing a string without milliseconds creates a correct representation ...
@ilueckel I think we currently support `2019-03-25T06:41:00.654` (3 digits ms), you could try this first to see if it works as expected. Plus, just wondering what's this date format that contains 6 digits millisecond? Restricting it to three digits would fix it. I'll guess I do this instead. The date strings ar...
2020-08-18T09:13:20Z
1.8
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)", "test/plugin/utc.test.js" ]
[ "test/parse.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,015
iamkun__dayjs-1015
[ "1007" ]
6e5ffce3af00df88428ac3634d6a89c985d79217
diff --git a/src/constant.js b/src/constant.js --- a/src/constant.js +++ b/src/constant.js @@ -26,5 +26,5 @@ export const FORMAT_DEFAULT = 'YYYY-MM-DDTHH:mm:ssZ' export const INVALID_DATE_STRING = 'Invalid Date' // regex -export const REGEX_PARSE = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?...
diff --git a/test/parse.test.js b/test/parse.test.js --- a/test/parse.test.js +++ b/test/parse.test.js @@ -81,6 +81,14 @@ describe('Parse', () => { expect(normalized.toISOString()).toEqual(expected) }) + it('parses unlimited millisecond', () => { + const date = '2019-03-25T06:41:00.999999999' + const d...
dayjs.duration().humanize() international My code: ``` import dayjs from 'dayjs' import duration from 'dayjs/plugin/duration' import relativeTime from 'dayjs/plugin/relativeTime' import localeData from 'dayjs/plugin/localeData' import 'dayjs/locale/zh-cn' dayjs.extend(duration) dayjs.extend(relativeTime) d...
2020-08-20T03:24:14Z
1.8
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)", "test/plugin/utc.test.js" ]
[ "test/parse.test.js", "test/plugin/timezone.test.js", "test/plugin/duration.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,019
iamkun__dayjs-1019
[ "1017" ]
e1890c969122c677350af2f457b7066d1fcf787a
diff --git a/src/plugin/localeData/index.js b/src/plugin/localeData/index.js --- a/src/plugin/localeData/index.js +++ b/src/plugin/localeData/index.js @@ -18,6 +18,7 @@ export default (o, c, dayjs) => { // locale needed later monthsShort: instance => (instance ? instance.format('MMM') : getShort(this, '...
diff --git a/test/plugin/localeData.test.js b/test/plugin/localeData.test.js --- a/test/plugin/localeData.test.js +++ b/test/plugin/localeData.test.js @@ -1,11 +1,11 @@ import MockDate from 'mockdate' import moment from 'moment' import dayjs from '../../src' -import localeData from '../../src/plugin/localeData' -imp...
LocaleData: weekdays is not a function on instance level **Describe the bug** When using localeData from an instance the error `weekdays is not a function` is thrown. Steps to reproduce: ```ts dayjs().localeData().weekdays() ``` Using the global function it works: ```ts dayjs.localeData().weekdays() ``` ...
2020-08-21T02:50:41Z
1.8
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/localeData.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,023
iamkun__dayjs-1023
[ "1022" ]
a09d259a407b81d1cb6bb5623fad551c775d8674
diff --git a/src/utils.js b/src/utils.js --- a/src/utils.js +++ b/src/utils.js @@ -18,9 +18,9 @@ const monthDiff = (a, b) => { // function from moment.js in order to keep the same result if (a.date() < b.date()) return -monthDiff(b, a) const wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month(...
diff --git a/test/plugin/badMutable.test.js b/test/plugin/badMutable.test.js --- a/test/plugin/badMutable.test.js +++ b/test/plugin/badMutable.test.js @@ -164,6 +164,16 @@ it('Locale', () => { expect(d.format(format)).toBe(m.format(format)) }) +it('Diff', () => { + const d = dayjs() + const m = moment() + cons...
RelativeTime plugin bug while using BadMutable plugin **Describe the bug** When I use RelativeTime plugin with BadMutable plugin in my react project, I get wrong answer. For Example: The time variable gets `in infinity years` instead of `4 months ago`. ```javascript import React from 'react'; import dayjs from '...
2020-08-22T09:10:02Z
1.8
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/badMutable.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,031
iamkun__dayjs-1031
[ "1017" ]
e1890c969122c677350af2f457b7066d1fcf787a
diff --git a/src/locale/nl.js b/src/locale/nl.js --- a/src/locale/nl.js +++ b/src/locale/nl.js @@ -10,6 +10,7 @@ const locale = { monthsShort: 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_'), ordinal: n => `${n}.`, weekStart: 1, + yearStart: 4, formats: { LT: 'HH:mm', LTS: 'HH:mm:ss'...
diff --git a/test/plugin/badMutable.test.js b/test/plugin/badMutable.test.js --- a/test/plugin/badMutable.test.js +++ b/test/plugin/badMutable.test.js @@ -164,6 +164,16 @@ it('Locale', () => { expect(d.format(format)).toBe(m.format(format)) }) +it('Diff', () => { + const d = dayjs() + const m = moment() + cons...
LocaleData: weekdays is not a function on instance level **Describe the bug** When using localeData from an instance the error `weekdays is not a function` is thrown. Steps to reproduce: ```ts dayjs().localeData().weekdays() ``` Using the global function it works: ```ts dayjs.localeData().weekdays() ``` ...
Thanks. Fixed in #1019
2020-09-02T13:05:39Z
1.8
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/badMutable.test.js", "test/plugin/localeData.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,047
iamkun__dayjs-1047
[ "1041" ]
cdc49a1911c74b7ea96ed222f42796d53715cfed
diff --git a/build/index.js b/build/index.js --- a/build/index.js +++ b/build/index.js @@ -8,17 +8,34 @@ const { ncp } = require('ncp') const { promisify } = util const promisifyReadDir = promisify(fs.readdir) +const promisifyReadFile = promisify(fs.readFile) +const promisifyWriteFile = promisify(fs.writeFile) +c...
diff --git a/test/locale/keys.test.js b/test/locale/keys.test.js --- a/test/locale/keys.test.js +++ b/test/locale/keys.test.js @@ -4,14 +4,17 @@ import dayjs from '../../src' const localeDir = '../../src/locale' const Locale = [] +const localeNameRegex = /\/\/ (.*) \[/ // load all locales from locale dir fs.rea...
Export list of locales available, and a function to require an Array of locales Can you please export the list of locales available? This would be a much better approach than having to manually write it out or programmatically use `fs.readdirSync` to get the full list. It would also be nice to have an option to load ...
That sounds cool. Maybe we could add a JSON output file in each npm release. like ``` root_path/locale.json ``` ``` [ { "key": "ca", "name": "English (Canada)" }, { "key": "en-gb", "name": "English (United Kingdom)" }, ... ] ```
2020-09-14T08:37:14Z
1.8
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/locale/keys.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,053
iamkun__dayjs-1053
[ "961" ]
c0f088620f17260e6e3ebce7697d561b5623f5f3
diff --git a/src/index.js b/src/index.js --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,6 @@ import * as C from './constant' -import U from './utils' import en from './locale/en' +import U from './utils' let L = 'en' // global locale const Ls = {} // global loaded locale @@ -43,6 +43,7 @@ const wrapper = (date,...
diff --git a/test/timezone.test.js b/test/timezone.test.js --- a/test/timezone.test.js +++ b/test/timezone.test.js @@ -1,5 +1,5 @@ -import moment from 'moment' import MockDate from 'mockdate' +import moment from 'moment' import dayjs from '../src' import utc from '../src/plugin/utc' @@ -54,3 +54,11 @@ it('UTC add ...
Add Latin locale For [romcal](https://github.com/romcal/romcal), I need to add Latin locale to `dayjs`. Therefore I have some questions regarding this. --- 1. As Latin weekday names are composed mostly of two words (like `feria secunda` for Monday), should I use a command as follows? ```js weekdays: 'Dominica...
1. it's perfectly ok to use normal Array []. 2. It's up to you cause you are a native speaker. One locale or three locales will both be fine. 3. It's ok. 4. I don't really understand. Can you detail it, please? 5. There's no need, just add our own in the first place. We use ISO 639-2 country code. Check lists s...
2020-09-17T08:41:06Z
1.8
[]
[ "test/timezone.test.js(1)" ]
JavaScript
[]
[]
iamkun/dayjs
1,054
iamkun__dayjs-1054
[ "1041" ]
82b50343521ca5ec41a2faf2f05c4d9050801308
diff --git a/build/index.js b/build/index.js --- a/build/index.js +++ b/build/index.js @@ -8,17 +8,34 @@ const { ncp } = require('ncp') const { promisify } = util const promisifyReadDir = promisify(fs.readdir) +const promisifyReadFile = promisify(fs.readFile) +const promisifyWriteFile = promisify(fs.writeFile) +c...
diff --git a/test/locale/hr.test.js b/test/locale/hr.test.js new file mode 100644 --- /dev/null +++ b/test/locale/hr.test.js @@ -0,0 +1,18 @@ +import moment from 'moment' +import dayjs from '../../src' +import '../../src/locale/hr' + +it('Format month with locale function', () => { + for (let i = 0; i <= 7; i += 1) { ...
Export list of locales available, and a function to require an Array of locales Can you please export the list of locales available? This would be a much better approach than having to manually write it out or programmatically use `fs.readdirSync` to get the full list. It would also be nice to have an option to load ...
2020-09-17T09:18:02Z
1.8
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/locale/lt.test.js", "test/locale/hr.test.js", "test/locale/pl.test.js", "test/plugin/timezone.test.js", "test/plugin/duration.test.js", "test/locale/keys.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,062
iamkun__dayjs-1062
[ "1061" ]
c0f088620f17260e6e3ebce7697d561b5623f5f3
diff --git a/src/plugin/minMax/index.js b/src/plugin/minMax/index.js --- a/src/plugin/minMax/index.js +++ b/src/plugin/minMax/index.js @@ -1,7 +1,7 @@ export default (o, c, d) => { const sortBy = (method, dates) => { - if (!dates.length) { - return d() + if (!dates || !dates.length || !dates[0] || (dates...
diff --git a/test/plugin/minMax.test.js b/test/plugin/minMax.test.js --- a/test/plugin/minMax.test.js +++ b/test/plugin/minMax.test.js @@ -18,10 +18,21 @@ const arg3 = dayjs('2017-01-01') const arg4 = dayjs('Invalid Date') it('Return current time if no argument', () => { - expect(dayjs.max().format()) - .toBe(d...
An unexpected type returned from dayjs.minMax when called with empty array **Describe the bug** An empty array is very unexpected here: typeof dayjs.max([]) === 'array'; // true there's an example: https://jsfiddle.net/7y5f6r3g/1/ **Expected behavior** I expect to see either falsy value or a thrown e...
2020-09-21T02:32:04Z
1.8
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/minMax.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,086
iamkun__dayjs-1086
[ "1079" ]
a78956e8664afa61bb2744c7a1bbe01d2589a4fe
diff --git a/src/index.js b/src/index.js --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,6 @@ import * as C from './constant' -import U from './utils' import en from './locale/en' +import U from './utils' let L = 'en' // global locale const Ls = {} // global loaded locale @@ -43,6 +43,7 @@ const wrapper = (date,...
diff --git a/test/plugin/advancedFormat.test.js b/test/plugin/advancedFormat.test.js --- a/test/plugin/advancedFormat.test.js +++ b/test/plugin/advancedFormat.test.js @@ -4,8 +4,12 @@ import dayjs from '../../src' import advancedFormat from '../../src/plugin/advancedFormat' import weekOfYear from '../../src/plugin/we...
`dayjs.tz()` needs to have timezone parameter as optional **Describe the bug** Because you can set a default timezone, the `dayjs.tz()` method should have the second parameter (timezone) as optional. It works fine in JS — just missing the correct types for TS. **Expected behavior** 1. Set `dayjs.tz.setDefault("Am...
2020-09-28T02:27:17Z
1.8
[]
[ "test/timezone.test.js(1)" ]
JavaScript
[]
[]
iamkun/dayjs
1,099
iamkun__dayjs-1099
[ "1093" ]
2e1e42650124f30282dc4d710798d576b928f1c7
diff --git a/src/plugin/duration/index.js b/src/plugin/duration/index.js --- a/src/plugin/duration/index.js +++ b/src/plugin/duration/index.js @@ -176,4 +176,13 @@ export default (option, Dayjs, dayjs) => { return wrapper(input, { $l }, unit) } dayjs.isDuration = isDuration + + const oldAdd = Dayjs.prototyp...
diff --git a/test/plugin/duration.test.js b/test/plugin/duration.test.js --- a/test/plugin/duration.test.js +++ b/test/plugin/duration.test.js @@ -138,6 +138,12 @@ describe('Add', () => { expect(a.add({ days: 5 }).days()).toBe(6) }) +describe('Add duration', () => { + const a = dayjs('2020-10-01') + const days ...
dayjs().add(Duration) API Hello, I'm replacing moment.js with `dayjs` in a project. I'm not sure if the APIs are not compatible at this point or I'm making a mistake here: ``` // the old code basically had `moment` where you see dayjs now const date1 = dayjs('2018-04-04T16:00:00.000Z') const date2 = dayjs();...
Day.js does not support adding `Duration` at present. However, we could support it in the Duration plugin if needed. This will be a nice feature added to the `Duration` plugin. It's much like the workaround code mentioned above. Feel free to draft a PR if anyone is interested in it.
2020-10-01T07:10:44Z
1.9
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/duration.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,101
iamkun__dayjs-1101
[ "1105" ]
16937d16e053b8c1d4a607622fa2fdbfd9809832
diff --git a/src/plugin/localeData/index.js b/src/plugin/localeData/index.js --- a/src/plugin/localeData/index.js +++ b/src/plugin/localeData/index.js @@ -1,3 +1,5 @@ +import { t } from '../localizedFormat' + export default (o, c, dayjs) => { // locale needed later const proto = c.prototype const getLocalePart =...
diff --git a/test/plugin/localeData.test.js b/test/plugin/localeData.test.js --- a/test/plugin/localeData.test.js +++ b/test/plugin/localeData.test.js @@ -38,7 +38,7 @@ describe('Instance localeData', () => { expect(dayjsLocaleData.weekdaysMin()).toEqual(momentLocaleData.weekdaysMin()) expect(dayjsLocaleD...
wrong day in my timezone (UTC+3) **Describe the bug** I noticed a utc test failing after midnight at my timezone. **Expected behavior** Run tests. **Information** - Day.js dev branch - OS: macos - Node v14.11.0 - Time zone:(UTC+3) ![Screenshot 2020-10-02 at 1 55 43](https://user-images.githubusercont...
2020-10-01T09:36:08Z
1.9
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/localeData.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,112
iamkun__dayjs-1112
[ "1111" ]
7937ccdeac47d094a60e65ebb62a6020b81c46f4
diff --git a/src/locale/hu.js b/src/locale/hu.js --- a/src/locale/hu.js +++ b/src/locale/hu.js @@ -13,17 +13,17 @@ const locale = { relativeTime: { future: '%s múlva', past: '%s', - s: 'néhány másodperc', - m: 'egy perc', - mm: '%d perc', - h: 'egy óra', - hh: '%d óra', - d: 'egy nap', - ...
diff --git a/test/locale/hu.test.js b/test/locale/hu.test.js new file mode 100644 --- /dev/null +++ b/test/locale/hu.test.js @@ -0,0 +1,45 @@ +import moment from 'moment' +import dayjs from '../../src' +import relativeTime from '../../src/plugin/relativeTime' +import '../../src/locale/hu' + +dayjs.extend(relativeTime) ...
Improve hungarian localization Hi! I would like to improve the hungarian localization! Currently the package does not handle the past relative times at all. The main problem is that in hungarian we don't have a single word to show that a date is in the past, like `ago` in english. Instead we add letters to each word...
Maybe this is what you are looking for https://day.js.org/docs/en/customization/relative-time#additional-token-processing Exactly, thanks, will customize my localization locally and once it's looking good I will create a PR to provide a fix for everybody.
2020-10-04T18:13:22Z
1.9
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/locale/hu.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,131
iamkun__dayjs-1131
[ "1105" ]
ae83edf56f7b9d24e6587b385fa650284426115f
diff --git a/src/locale/ar-kw.js b/src/locale/ar-kw.js --- a/src/locale/ar-kw.js +++ b/src/locale/ar-kw.js @@ -3,9 +3,9 @@ import dayjs from 'dayjs' const locale = { name: 'ar-kw', - weekdays: 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), + weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_ا...
diff --git a/test/locale/br.test.js b/test/locale/br.test.js new file mode 100644 --- /dev/null +++ b/test/locale/br.test.js @@ -0,0 +1,54 @@ +import moment from 'moment' +import MockDate from 'mockdate' +import dayjs from '../../src' +import relativeTime from '../../src/plugin/relativeTime' +import '../../src/locale/b...
wrong day in my timezone (UTC+3) **Describe the bug** I noticed a utc test failing after midnight at my timezone. **Expected behavior** Run tests. **Information** - Day.js dev branch - OS: macos - Node v14.11.0 - Time zone:(UTC+3) ![Screenshot 2020-10-02 at 1 55 43](https://user-images.githubusercont...
2020-10-13T08:37:48Z
1.9
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/arraySupport.test.js", "test/locale/br.test.js", "test/locale/sr.test.js", "test/locale/sr-cyrl.test.js", "test/locale/de.test.js", "test/plugin/duration.test.js", "test/plugin/objectSupport.test.js", "test/plugin/localeData.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,160
iamkun__dayjs-1160
[ "1159" ]
1d429e5fe4467ebddcf81b43cf6f36e5e3be944c
diff --git a/src/plugin/timezone/index.js b/src/plugin/timezone/index.js --- a/src/plugin/timezone/index.js +++ b/src/plugin/timezone/index.js @@ -114,14 +114,16 @@ export default (o, c, d) => { return result && result.value } - d.tz = function (input, timezone = defaultTimezone) { + d.tz = function (input,...
diff --git a/test/plugin/timezone.test.js b/test/plugin/timezone.test.js --- a/test/plugin/timezone.test.js +++ b/test/plugin/timezone.test.js @@ -2,10 +2,12 @@ import MockDate from 'mockdate' import moment from 'moment-timezone' import dayjs from '../../src' import timezone from '../../src/plugin/timezone' +import ...
the unix timestamp didnt not pick up the timezone change correctly **Describe the bug** How to get the correct time stamp with a time on a specific timezone ? I want to check the unix timestamp for 10/15/2020 12:30 PM at Denver, but neither of the approaches (3 and 4) works. 1. //Los Angeles (correct) console.lo...
You can use `dayjs.tz('2020/10/15 10:30', 'America/Denver').unix()` to get the correct result `1602779400` at this moment. We will support custom format parsing in `dayjs.tz` in a short time. > 10:30 Did you mean 11:30 am for my current time at LA timezone to indicate 12:30pm at Denver ? Is there anyway to calcul...
2020-10-21T03:32:38Z
1.9
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/timezone.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,161
iamkun__dayjs-1161
[ "1149" ]
9a407a140b089345a387d1aceab4d0d1635229c7
diff --git a/src/plugin/timezone/index.js b/src/plugin/timezone/index.js --- a/src/plugin/timezone/index.js +++ b/src/plugin/timezone/index.js @@ -1,3 +1,5 @@ +import { MIN, MS } from '../../constant' + const typeToPos = { year: 0, month: 1, @@ -7,8 +9,6 @@ const typeToPos = { second: 5 } -const ms = 'ms' ...
diff --git a/test/plugin/timezone.test.js b/test/plugin/timezone.test.js --- a/test/plugin/timezone.test.js +++ b/test/plugin/timezone.test.js @@ -1,8 +1,8 @@ import MockDate from 'mockdate' import moment from 'moment-timezone' import dayjs from '../../src' -import utc from '../../src/plugin/utc' import timezone fr...
Only changing the timezone (similar to moment.tz(keeptime=true)) Here is a code sample from Moment's timezone. I would like to achieve the `true` flag so only the offset changes when time stays the same. ``` var m = moment.tz("2013-11-18 11:55", "America/Toronto"); m.format(); // 2013-11-18...
@iamkun bumping this issue. Is this feature already available?
2020-10-21T08:06:37Z
1.9
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/timezone.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,164
iamkun__dayjs-1164
[ "1159" ]
c0200e40ba7f4ae896fac03ec1dbab24d00f4e6f
diff --git a/src/index.js b/src/index.js --- a/src/index.js +++ b/src/index.js @@ -401,5 +401,5 @@ dayjs.unix = timestamp => ( dayjs.en = Ls[L] dayjs.Ls = Ls - +dayjs.p = {} export default dayjs diff --git a/src/locale/en-nz.js b/src/locale/en-nz.js --- a/src/locale/en-nz.js +++ b/src/locale/en-nz.js @@ -9,7 +9,11...
diff --git a/test/locale/hu.test.js b/test/locale/hu.test.js new file mode 100644 --- /dev/null +++ b/test/locale/hu.test.js @@ -0,0 +1,45 @@ +import moment from 'moment' +import dayjs from '../../src' +import relativeTime from '../../src/plugin/relativeTime' +import '../../src/locale/hu' + +dayjs.extend(relativeTime) ...
the unix timestamp didnt not pick up the timezone change correctly **Describe the bug** How to get the correct time stamp with a time on a specific timezone ? I want to check the unix timestamp for 10/15/2020 12:30 PM at Denver, but neither of the approaches (3 and 4) works. 1. //Los Angeles (correct) console.lo...
2020-10-23T06:42:11Z
1.9
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/minMax.test.js", "test/locale/hu.test.js", "test/plugin/duration.test.js", "test/plugin/timezone.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,184
iamkun__dayjs-1184
[ "1172" ]
e21aa170a31e4b4c4078adf1cdc4983bb98e6a4f
diff --git a/src/index.js b/src/index.js --- a/src/index.js +++ b/src/index.js @@ -76,7 +76,7 @@ const parseDate = (cfg) => { class Dayjs { constructor(cfg) { - this.$L = this.$L || parseLocale(cfg.locale, null, true) + this.$L = parseLocale(cfg.locale, null, true) this.parse(cfg) // for plugin } ...
diff --git a/test/plugin/customParseFormat.test.js b/test/plugin/customParseFormat.test.js --- a/test/plugin/customParseFormat.test.js +++ b/test/plugin/customParseFormat.test.js @@ -1,12 +1,14 @@ import MockDate from 'mockdate' import moment from 'moment' import dayjs from '../../src' -import customParseFormat from...
What is the equivalent of this moment code momentDateObj.localeData().meridiem? **Describe the bug** What is the equivalent of this moment code momentDateObj.localeData().meridiem? In moment I did this: ``` momentDateObj.localeData().meridiem = function (hours) { return hours > 11 ? I18NService...
2020-11-05T06:05:08Z
1.9
[ "test/timezone.test.js(1)" ]
[ "test/timezone.test.js(2)" ]
JavaScript
[]
[]
iamkun/dayjs
1,201
iamkun__dayjs-1201
[ "1200" ]
ed9629b5ab2895652111fc854e6081422ed5c010
diff --git a/src/plugin/utc/index.js b/src/plugin/utc/index.js --- a/src/plugin/utc/index.js +++ b/src/plugin/utc/index.js @@ -112,7 +112,7 @@ export default (option, Dayjs, dayjs) => { } const oldDiff = proto.diff proto.diff = function (input, units, float) { - if (this.$u === input.$u) { + if (input &&...
diff --git a/test/plugin/utc.test.js b/test/plugin/utc.test.js --- a/test/plugin/utc.test.js +++ b/test/plugin/utc.test.js @@ -237,6 +237,9 @@ describe('Diff', () => { expect(_.utc(d1).diff(_.utc(d2), 'm')).toBe(1440) }) }) + it('default diff', () => { + expect(dayjs().diff()).toBeDefined() + }) ...
Cannot read property '$u' of undefined **Describe the bug** 1.9.4 ``` dayjs('2020-11-02T02:58:28.000-08:00').diff() -703365300 ``` 1.9.5 and 1.9.6 ``` dayjs('2020-11-02T02:58:28.000-08:00').diff() TypeError: Cannot read property '$u' of undefined at diff (/home/circleci/project/node_modules/dayjs/plug...
2020-11-10T15:00:27Z
1.9
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/utc.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,202
iamkun__dayjs-1202
[ "965" ]
9544ed2a6c466b8308d26b33a388a6737435a1f4
diff --git a/src/constant.js b/src/constant.js --- a/src/constant.js +++ b/src/constant.js @@ -27,4 +27,4 @@ export const INVALID_DATE_STRING = 'Invalid Date' // regex export const REGEX_PARSE = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?.?(\d+)?$/ -export const REGEX_FORMAT = /\...
diff --git a/test/plugin/duration.test.js b/test/plugin/duration.test.js --- a/test/plugin/duration.test.js +++ b/test/plugin/duration.test.js @@ -208,3 +208,27 @@ describe('prettyUnit', () => { m: 12 }).toISOString()).toBe('P12MT12M') }) + +describe('Format', () => { + test('no formatStr', () => { + const...
How we can format the duration in dayjs. I have tried o use this but it does not work ``` import dayjs from 'dayjs'; import duration from 'dayjs/plugin/duration'; dayjs.extend(duration); const toTimeFormat = (milliseconds: number) => { return dayjs.duration(milliseconds).format('HH:mm:ss') }; ```
Will add this later. @iamkun , Please let me know once this issue is fixed @iamkun let me know too. We need it too.
2020-11-10T17:24:08Z
1.9
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/duration.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,209
iamkun__dayjs-1209
[ "1205" ]
9544ed2a6c466b8308d26b33a388a6737435a1f4
diff --git a/src/plugin/customParseFormat/index.js b/src/plugin/customParseFormat/index.js --- a/src/plugin/customParseFormat/index.js +++ b/src/plugin/customParseFormat/index.js @@ -8,14 +8,15 @@ const match3 = /\d{3}/ // 000 - 999 const match4 = /\d{4}/ // 0000 - 9999 const match1to2 = /\d\d?/ // 0 - 99 const matc...
diff --git a/test/plugin/customParseFormat.test.js b/test/plugin/customParseFormat.test.js --- a/test/plugin/customParseFormat.test.js +++ b/test/plugin/customParseFormat.test.js @@ -101,6 +101,22 @@ it('timezone with no hour', () => { expect(dayjs(input, format).valueOf()).toBe(moment(input, format).valueOf()) }) ...
Day.js doesn't parse ISO 8601 timezone offset +NN **Describe the bug** PostgreSQL is returning ```time with time zone``` fields in this ISO 8601 format: ```2020-12-01T20:00:00+00```. Note that it's using a 2-digit offset which is part of the ISO specification, along with the 4-digit colon-separated format (which Day.j...
Will support in the next release.
2020-11-12T02:34:37Z
1.9
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/customParseFormat.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,254
iamkun__dayjs-1254
[ "1205" ]
ed9629b5ab2895652111fc854e6081422ed5c010
diff --git a/src/constant.js b/src/constant.js --- a/src/constant.js +++ b/src/constant.js @@ -27,4 +27,4 @@ export const INVALID_DATE_STRING = 'Invalid Date' // regex export const REGEX_PARSE = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?.?(\d+)?$/ -export const REGEX_FORMAT = /\...
diff --git a/test/display.test.js b/test/display.test.js --- a/test/display.test.js +++ b/test/display.test.js @@ -215,6 +215,10 @@ describe('Difference', () => { expect(dayjs('2018-08-08').diff(dayjs('2018-09-08'), 'month')).toEqual(-1) expect(dayjs('2018-01-01').diff(dayjs('2018-01-01'), 'month')).toEqual(0...
Day.js doesn't parse ISO 8601 timezone offset +NN **Describe the bug** PostgreSQL is returning ```time with time zone``` fields in this ISO 8601 format: ```2020-12-01T20:00:00+00```. Note that it's using a 2-digit offset which is part of the ISO specification, along with the 4-digit colon-separated format (which Day.j...
2020-12-05T14:45:09Z
1.9
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)", "test/timezone.test.js(5)", "test/plugin/timezone.test.js", "test/display.test.js" ]
[ "test/plugin/customParseFormat.test.js", "test/plugin/utc.test.js", "test/plugin/duration.test.js", "test/plugin/relativeTime.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,295
iamkun__dayjs-1295
[ "1239" ]
de49bb100badfb92b9a5933cc568841f340a923f
diff --git a/src/constant.js b/src/constant.js --- a/src/constant.js +++ b/src/constant.js @@ -26,5 +26,5 @@ export const FORMAT_DEFAULT = 'YYYY-MM-DDTHH:mm:ssZ' export const INVALID_DATE_STRING = 'Invalid Date' // regex -export const REGEX_PARSE = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?...
diff --git a/test/parse.test.js b/test/parse.test.js --- a/test/parse.test.js +++ b/test/parse.test.js @@ -148,4 +148,34 @@ describe('REGEX_PARSE', () => { expect(dayjs(date).valueOf()).toBe(moment(date).valueOf()) expect(d.join('-')).toBe('2019-03-25T06:41:00.999999999-2019-03-25-06-41-00-999999999') }) +...
dayjs.utc() dropped timezone offset support **Describe the bug** `dayjs.utc('2020-12-01T09:00:00+0900').toDate().getTime() === new Date('2020-12-01T09:00:00+0900').getTime()` **Expected behavior** The above evaluates to true. It's the behaviour of dayjs 1.8.33. **Actual behaviour** ``` > dayjs.utc('2020-12-0...
``` dayjs.utc('2020-12-01T09:00:00+0900').toDate().getTime() === new Date('2020-12-01T09:00:00+0900').getTime() === dayjs('2020-12-01T09:00:00+0900').toDate().getTime() ``` The above three should have the same result. Cause it represents the same time '2020-12-01T09:00:00+0900' There was my mistake in th...
2020-12-31T06:01:54Z
1.9
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/parse.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,299
iamkun__dayjs-1299
[ "313" ]
fb3dd1b692966fdc41839ab4962deca9715f2d50
diff --git a/src/constant.js b/src/constant.js --- a/src/constant.js +++ b/src/constant.js @@ -26,5 +26,5 @@ export const FORMAT_DEFAULT = 'YYYY-MM-DDTHH:mm:ssZ' export const INVALID_DATE_STRING = 'Invalid Date' // regex -export const REGEX_PARSE = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?...
diff --git a/test/locale/ar.test.js b/test/locale/ar.test.js new file mode 100644 --- /dev/null +++ b/test/locale/ar.test.js @@ -0,0 +1,52 @@ +import moment from 'moment' +import MockDate from 'mockdate' +import dayjs from '../../src' +import relativeTime from '../../src/plugin/relativeTime' +import preParsePostFormat ...
ES6 Module Support? I am trying to use this library in a polymer 3 typescript project. Would it be possible to add support for es6 modules? Code ```javascript import dayjs from 'dayjs'; ``` Result ``` my-app.ts:73 One or more components failed to load SyntaxError: The requested module '../node_modules/dayjs...
try this `import * as dayjs from 'dayjs';` When i import like that i receive an error ``` One or more components failed to load TypeError: Cannot set property 'dayjs' of undefined ``` Is there something i have not configured properly with typescript perhaps? Have you ever tried the `--allowSyntheticDefaultImpo...
2021-01-03T08:06:07Z
1.9
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)", "test/locale/ja.test.js" ]
[ "test/plugin/preParsePostFormat.test.js", "test/parse.test.js", "test/locale/ar.test.js", "test/plugin/localeData.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,307
iamkun__dayjs-1307
[ "1305" ]
bfaabe4f398c11564eca6cda7c8aded22e1b231a
diff --git a/src/constant.js b/src/constant.js --- a/src/constant.js +++ b/src/constant.js @@ -26,5 +26,5 @@ export const FORMAT_DEFAULT = 'YYYY-MM-DDTHH:mm:ssZ' export const INVALID_DATE_STRING = 'Invalid Date' // regex -export const REGEX_PARSE = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?...
diff --git a/test/parse.test.js b/test/parse.test.js --- a/test/parse.test.js +++ b/test/parse.test.js @@ -174,6 +174,14 @@ describe('REGEX_PARSE', () => { expect(d).toBe(null) }) + // format used in timezone plugin utcString + it('2021-1-4 0:42:53:000', () => { + const date = '2021-1-4 0:42:53:000' + ...
Converting an timezoned instance to another timezone returns the wrong result **Describe the bug** I am trying to convert a time that I parsed using `dayjs.tz` into another timezone, but it appears to return the incorrect value. This appears to be a regression, as it appears to work properly in `1.9.7`, though I'm no...
Seems to work properly in `1.9.8` and broke in `1.10.0`. bug confirmed, will fix soon
2021-01-04T14:25:39Z
1.10
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/parse.test.js" ]
JavaScript
[ "https://user-images.githubusercontent.com/5668416/103511419-e18b0500-4e1b-11eb-9574-991b0392750b.png", "https://user-images.githubusercontent.com/5668416/103511385-cddf9e80-4e1b-11eb-99ee-a2f80bf7c26b.png" ]
[]
iamkun/dayjs
1,316
iamkun__dayjs-1316
[ "1305" ]
873b749e67f35f206bccdcd9cac367ee0b475203
diff --git a/src/constant.js b/src/constant.js --- a/src/constant.js +++ b/src/constant.js @@ -26,5 +26,5 @@ export const FORMAT_DEFAULT = 'YYYY-MM-DDTHH:mm:ssZ' export const INVALID_DATE_STRING = 'Invalid Date' // regex -export const REGEX_PARSE = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?...
diff --git a/test/parse.test.js b/test/parse.test.js --- a/test/parse.test.js +++ b/test/parse.test.js @@ -174,6 +174,14 @@ describe('REGEX_PARSE', () => { expect(d).toBe(null) }) + // format used in timezone plugin utcString + it('2021-1-4 0:42:53:000', () => { + const date = '2021-1-4 0:42:53:000' + ...
Converting an timezoned instance to another timezone returns the wrong result **Describe the bug** I am trying to convert a time that I parsed using `dayjs.tz` into another timezone, but it appears to return the incorrect value. This appears to be a regression, as it appears to work properly in `1.9.7`, though I'm no...
Seems to work properly in `1.9.8` and broke in `1.10.0`. bug confirmed, will fix soon
2021-01-05T23:42:16Z
1.10
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/devHelper.test.js", "test/parse.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,319
iamkun__dayjs-1319
[ "1304" ]
cc993f0a8d18d33c0137616b80adc86127ba3424
diff --git a/src/plugin/weekYear/index.js b/src/plugin/weekYear/index.js --- a/src/plugin/weekYear/index.js +++ b/src/plugin/weekYear/index.js @@ -7,6 +7,9 @@ export default (o, c) => { if (weekOfYear === 1 && month === 11) { return year + 1 } + if (month === 0 && weekOfYear >= 52) { + return y...
diff --git a/test/plugin/weekYear.test.js b/test/plugin/weekYear.test.js --- a/test/plugin/weekYear.test.js +++ b/test/plugin/weekYear.test.js @@ -3,6 +3,7 @@ import MockDate from 'mockdate' import dayjs from '../../src' import weekYear from '../../src/plugin/weekYear' import weekOfYear from '../../src/plugin/weekOf...
gggg not working correctly **Describe the bug** gggg not returns week year, but just a year The same functionality in moment js works correctly ```javascript const dayjs = require('dayjs'); const moment = require('moment') const weekOfYear = require('dayjs/plugin/weekOfYear'); const weekYear = require('dayjs/p...
<del>-</del> Sorry for the wrong reply above. gggg should return the Week Year in Day.js the same as moment.js. I've tested ok on my side, https://runkit.com/embed/9x7snt5xa0ts ![image](https://user-images.githubusercontent.com/17680888/103508148-839e0200-4e9b-11eb-93ec-ad86034ea704.png) It's ok in your...
2021-01-06T16:05:45Z
1.10
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/weekYear.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,321
iamkun__dayjs-1321
[ "1238" ]
344bdc0eed6843edb05723dc7853a41833d88f08
diff --git a/src/plugin/customParseFormat/index.js b/src/plugin/customParseFormat/index.js --- a/src/plugin/customParseFormat/index.js +++ b/src/plugin/customParseFormat/index.js @@ -11,7 +11,7 @@ const matchSigned = /[+-]?\d+/ // -inf - inf const matchOffset = /[+-]\d\d:?(\d\d)?/ // +00:00 -00:00 +0000 or -0000 +00 ...
diff --git a/test/plugin/customParseFormat.test.js b/test/plugin/customParseFormat.test.js --- a/test/plugin/customParseFormat.test.js +++ b/test/plugin/customParseFormat.test.js @@ -294,6 +294,8 @@ describe('Strict mode', () => { const format = 'YYYY-MM-DD' expect(dayjs(input, format).isValid()).toBe(true) ...
Invalid dates are parsed as valid Invalid dates are parsed resulting in incorrect values e.g, const dt = dayjs('1993-51-11') `dt.isValid()` returns `true` and `dt.format('YYYY-MM-DD')` returns `1997-03-11` const dt = dayjs('1993-51-41') `dt.isValid()` returns `true` and `dt.format('YYYY-MM-DD')` returns `1997-04-...
Yes, this is valid to js Date. You can use strict parsing to get what you need. https://day.js.org/docs/en/parse/string-format ``` dayjs('1970-00-00', 'YYYY-MM-DD', true).isValid() // false ``` Does Day.js strict parsing validate time formats as well? Following returns true. Should it return false since date s...
2021-01-07T12:23:39Z
1.10
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/customParseFormat.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,325
iamkun__dayjs-1325
[ "1264" ]
ac9076024507684ff50f1e9a67af1f9172b11ee1
diff --git a/src/locale/de.js b/src/locale/de.js --- a/src/locale/de.js +++ b/src/locale/de.js @@ -32,6 +32,7 @@ const locale = { monthsShort: 'Jan_Feb_März_Apr_Mai_Juni_Juli_Aug_Sept_Okt_Nov_Dez'.split('_'), ordinal: n => `${n}.`, weekStart: 1, + yearStart: 4, formats: { LTS: 'HH:mm:ss', LT: 'HH...
diff --git a/test/plugin/advancedFormat.test.js b/test/plugin/advancedFormat.test.js --- a/test/plugin/advancedFormat.test.js +++ b/test/plugin/advancedFormat.test.js @@ -2,6 +2,7 @@ import MockDate from 'mockdate' import moment from 'moment' import dayjs from '../../src' import advancedFormat from '../../src/plugin...
weekOfYear shows wrong calender week at the turn of the year Describe the bug The 2020-12-30 should be calender week 53 but it shows as calender week 1. (similar issue: #760) Calender weeks: http://www.whatweekisit.org/ Information Day.js Version 1.9.7 Browser Chrome latest
Hi, have you set the correct locale? yes, it is the same issue when i set 'us' | 'de' https://codepen.io/tompach/pen/OJRRpNE?editors=0012
2021-01-09T07:56:23Z
1.10
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/devHelper.test.js", "test/plugin/weekYear.test.js", "test/plugin/advancedFormat.test.js", "test/plugin/customParseFormat.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,414
iamkun__dayjs-1414
[ "1363" ]
b1abdc40ee6c9d18ff46c311a114e0755677ea6f
diff --git a/src/locale/es-do.js b/src/locale/es-do.js --- a/src/locale/es-do.js +++ b/src/locale/es-do.js @@ -6,7 +6,7 @@ const locale = { weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'), weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), weekdaysMin: 'do_lu_ma_mi_ju_v...
diff --git a/test/locale.test.js b/test/locale.test.js --- a/test/locale.test.js +++ b/test/locale.test.js @@ -17,7 +17,7 @@ const NOT_SUPPORTED_LOCALE_STRING = 'not_supported_locale_string' it('Uses spanish locale through constructor', () => { // not recommend expect(dayjs('2018-4-28', { locale: es }) .format...
Spanish days and months should be lowercase Spanish speaking people do not capitalize their months or days.
would you like to create a pull request to update it?
2021-03-13T19:51:51Z
1.10
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/locale.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,459
iamkun__dayjs-1459
[ "1354" ]
2ab64ac3e84375e167fe1b23cb2282c9fdb5c930
diff --git a/build/index.js b/build/index.js --- a/build/index.js +++ b/build/index.js @@ -35,23 +35,27 @@ async function listLocaleJson(localeArr) { (async () => { try { + /* eslint-disable no-restricted-syntax, no-await-in-loop */ + // We use await-in-loop to make rollup run sequentially to save on RAM ...
diff --git a/test/locale.test.js b/test/locale.test.js --- a/test/locale.test.js +++ b/test/locale.test.js @@ -17,7 +17,7 @@ const NOT_SUPPORTED_LOCALE_STRING = 'not_supported_locale_string' it('Uses spanish locale through constructor', () => { // not recommend expect(dayjs('2018-4-28', { locale: es }) .format...
1.10.4 broke duration creation type in typescript **Describe the bug** In your own documentation: https://day.js.org/docs/en/durations/add ```typescript var a = dayjs.duration(1, 'd'); var b = dayjs.duration(2, 'd'); a.add(b).days(); // 3 ``` it shows: ``` No overload matches this call. Overload 1 of 3, '...
maybe relate to #1338 cc @zardoy to check this together
2021-04-16T13:16:19Z
1.10
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)", "test/plugin/timezone.test.js" ]
[ "test/locale.test.js", "test/locale/ru.test.js", "test/plugin/utc.test.js", "test/plugin/duration.test.js", "test/plugin/customParseFormat.test.js", "test/locale/bn.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,470
iamkun__dayjs-1470
[ "1465" ]
0fdac93ff2531542301b76952be9b084b2e2dfa0
diff --git a/src/index.js b/src/index.js --- a/src/index.js +++ b/src/index.js @@ -251,11 +251,12 @@ class Dayjs { } format(formatStr) { - if (!this.isValid()) return C.INVALID_DATE_STRING + const locale = this.$locale() + + if (!this.isValid()) return locale.invalidDate || C.INVALID_DATE_STRING ...
diff --git a/test/plugin/updateLocale.test.js b/test/plugin/updateLocale.test.js --- a/test/plugin/updateLocale.test.js +++ b/test/plugin/updateLocale.test.js @@ -68,4 +68,15 @@ describe('Update locale', () => { expect(dayjs().format(formatString)) .toEqual(moment().format(formatString)) }) + + it('Upda...
`dayjs.updateLocale` does not support setting `invalidDate` string I am migrating a project from Moment.js to Day.js, but this project relies on `updateLocale` to display nullish dates as `-`. I see that Day.js always returns the same constant string when a date is invalid: https://github.com/iamkun/dayjs/blob/0fdac93f...
2021-04-21T22:23:30Z
1.10
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/updateLocale.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,502
iamkun__dayjs-1502
[ "1501" ]
06f88f425828b1ce96b737332d25145a95a4ee9d
diff --git a/src/locale/bg.js b/src/locale/bg.js --- a/src/locale/bg.js +++ b/src/locale/bg.js @@ -9,7 +9,23 @@ const locale = { months: 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split('_'), monthsShort: 'янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'), wee...
diff --git a/test/locale/bg.test.js b/test/locale/bg.test.js new file mode 100644 --- /dev/null +++ b/test/locale/bg.test.js @@ -0,0 +1,67 @@ +import moment from 'moment' +import MockDate from 'mockdate' +import dayjs from '../../src' +import relativeTime from '../../src/plugin/relativeTime' +import advancedFormat from...
Implement ordinal in Bulgarian translation Currently, the ordinal is missing from Bulgarian translation, or more correctly, it is implemented in a wrong way. Current: `25.` Expected: `25-ти`
2021-05-27T06:28:52Z
1.10
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/locale/bg.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,567
iamkun__dayjs-1567
[ "1533" ]
b5e40e6f16abeaea6a0facfa466d20aefaa8a444
diff --git a/src/plugin/customParseFormat/index.js b/src/plugin/customParseFormat/index.js --- a/src/plugin/customParseFormat/index.js +++ b/src/plugin/customParseFormat/index.js @@ -175,6 +175,7 @@ function makeParser(format) { const parseFormattedInput = (input, format, utc) => { try { + if (['x', 'X'].index...
diff --git a/test/plugin/customParseFormat.test.js b/test/plugin/customParseFormat.test.js --- a/test/plugin/customParseFormat.test.js +++ b/test/plugin/customParseFormat.test.js @@ -368,3 +368,12 @@ it('custom two-digit year parse function', () => { const input3 = '99-05-02' expect(dayjs(input3, format).year())....
Parsing with Unix Timestamp tokens X/x and strict mode results in Invalid Date **Describe the bug** When `x` and `X` from [dayjs/plugin/advancedFormat](https://day.js.org/docs/en/plugin/advanced-format) is used with strict mode parse fails: ```js dayjs(`/Date(${dayjs().format('x')})/`,"/[Date](x)/").format('/[Date...
2021-07-06T07:26:25Z
1.10
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/customParseFormat.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,568
iamkun__dayjs-1568
[ "1501" ]
aa5b524608c363a8b1e8b74b99c50ecb929075ce
diff --git a/src/constant.js b/src/constant.js --- a/src/constant.js +++ b/src/constant.js @@ -26,5 +26,5 @@ export const FORMAT_DEFAULT = 'YYYY-MM-DDTHH:mm:ssZ' export const INVALID_DATE_STRING = 'Invalid Date' // regex -export const REGEX_PARSE = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?...
diff --git a/test/locale/bg.test.js b/test/locale/bg.test.js new file mode 100644 --- /dev/null +++ b/test/locale/bg.test.js @@ -0,0 +1,67 @@ +import moment from 'moment' +import MockDate from 'mockdate' +import dayjs from '../../src' +import relativeTime from '../../src/plugin/relativeTime' +import advancedFormat from...
Implement ordinal in Bulgarian translation Currently, the ordinal is missing from Bulgarian translation, or more correctly, it is implemented in a wrong way. Current: `25.` Expected: `25-ти`
2021-07-06T07:33:49Z
1.10
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/parse.test.js", "test/locale/sv-fi.test.js", "test/plugin/updateLocale.test.js", "test/locale/bg.test.js", "test/plugin/badMutable.test.js", "test/plugin/customParseFormat.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,611
iamkun__dayjs-1611
[ "1521" ]
f68e4b1a29fc33542f74cde10ec6d9fb045ca37e
diff --git a/src/plugin/duration/index.js b/src/plugin/duration/index.js --- a/src/plugin/duration/index.js +++ b/src/plugin/duration/index.js @@ -84,7 +84,7 @@ class Duration { const d = input.match(durationRegex) if (d) { const properties = d.slice(2) - const numberD = properties.map(val...
diff --git a/test/plugin/duration.test.js b/test/plugin/duration.test.js --- a/test/plugin/duration.test.js +++ b/test/plugin/duration.test.js @@ -76,6 +76,9 @@ describe('Parse ISO string', () => { it('Part ISO string', () => { expect(dayjs.duration('PT2777H46M40S').toISOString()).toBe('PT2777H46M40S') }) + ...
Duration format result is not as expected **Describe the bug** When use duration format for an ISO8601, result it's not as expected : `myDuration = dayjs.duration('PT3M39.096S')` `myDuration.format("HH:mm:ss") => "NaN:03:39.096"` `myDuration.format("mm:ss") => "03:39.096"` `myDuration.format("ss") ...
Did you take a look at this issue ? Dou you need more test case ? I'm actually having a similar issue with the above problem with regards to `NaN` and would like to see it fixed if possible. Upon inspecting the code here: https://github.com/iamkun/dayjs/blob/5a79cc6408e825d9e123629eb44fc19c996d7751/src/plugin/durat...
2021-08-18T07:54:47Z
1.10
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/duration.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,725
iamkun__dayjs-1725
[ "1724" ]
5a108ff3159c53fd270ea7638f33c35c934d6457
diff --git a/src/locale/ku.js b/src/locale/ku.js --- a/src/locale/ku.js +++ b/src/locale/ku.js @@ -18,6 +18,7 @@ const locale = { LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm' }, + meridiem: hour => (hour < 12 ? 'پ.ن' : 'د.ن'), relativeTime: { future: 'له‌ %s', past: '%s',
diff --git a/test/locale/ku.test.js b/test/locale/ku.test.js new file mode 100644 --- /dev/null +++ b/test/locale/ku.test.js @@ -0,0 +1,20 @@ +import MockDate from 'mockdate' +import dayjs from '../../src' +import '../../src/locale/ku' + +beforeEach(() => { + MockDate.set(new Date()) +}) + +afterEach(() => { + MockDa...
Kurdish language is missing `meridiem` function **Describe the bug** in Kurdish language we have our version of `AM` and `PM` but because the `ku` locale isn't defining a `meridiem` function, the library will fallback to it's own version. In Kurdish, the mapping is like this: `AM` -> `پ.ن` `PM` -> `د.ن` Also, We...
2021-12-01T09:11:03Z
1.10
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/locale/ku.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
1,954
iamkun__dayjs-1954
[ "1941" ]
74e82b9da5ec8b90361fc27ac7c8b63faf354502
diff --git a/src/locale/ar-dz.js b/src/locale/ar-dz.js --- a/src/locale/ar-dz.js +++ b/src/locale/ar-dz.js @@ -17,7 +17,7 @@ const locale = { LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd D MMMM YYYY HH:mm' }, - meridiem: hour => (hour > 12 ? 'ص' : 'م'), + meridiem: hour => (hour > 12 ? 'م' : 'ص'), relativeTi...
diff --git a/test/locale/ar-dz.test.js b/test/locale/ar-dz.test.js new file mode 100644 --- /dev/null +++ b/test/locale/ar-dz.test.js @@ -0,0 +1,23 @@ +import MockDate from 'mockdate' +import dayjs from '../../src' +import relativeTime from '../../src/plugin/relativeTime' +import '../../src/locale/ru' +import locale fr...
Arabic locales: Meridiem is reversed **Describe the bug** while working on a project where I use Dayjs in, I have noticed that all meridiem uses Arabic locales are reversed. I have looked into the source code in Github and found ` meridiem: hour => (hour > 12 ? 'ص' : 'م'), ` which at first look it looks fine! b...
2022-06-19T02:41:55Z
1.11
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/locale/ar-dz.test.js", "test/locale/ar-ma.test.js", "test/locale/ar-iq.test.js", "test/locale/ar-ly.test.js", "test/locale/ar-sa.test.js", "test/locale/ar-tn.test.js", "test/locale/ar-kw.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
2,175
iamkun__dayjs-2175
[ "2095" ]
e4468a46de423e7590f045a9e0f4b4a7251298e0
diff --git a/src/plugin/objectSupport/index.js b/src/plugin/objectSupport/index.js --- a/src/plugin/objectSupport/index.js +++ b/src/plugin/objectSupport/index.js @@ -1,6 +1,6 @@ export default (o, c, dayjs) => { const proto = c.prototype - const isObject = obj => !(obj instanceof Date) && !(obj instanceof Array) ...
diff --git a/test/plugin/objectSupport.test.js b/test/plugin/objectSupport.test.js --- a/test/plugin/objectSupport.test.js +++ b/test/plugin/objectSupport.test.js @@ -384,3 +384,11 @@ it('add decimal values of days and months', () => { expect(dayjs([2016, 7, 1]).add(1.6, 'years').format('YYYY-MM-DD')).toBe('2017-07-...
`dayjs(null)` throws error, not return dayjs object as invalid date **Describe the bug** `dayjs(null)` is throws error, 'Uncaught TypeError: can't access property "constructor", n is null'. It says that error occured on dayjs/plugin/objectSupport.js ``` 11:11:19.151 objectSupport.js:1 Uncaught TypeError: Cannot rea...
+1 to this one Was also affected by this when date passed to `dayjs` instance is `null` Looks like introduced in `v1.11.6` [here](https://github.com/iamkun/dayjs/compare/v1.11.5...v1.11.6#diff-be0bd99afbfe14abf25ed63296e4354497068b423d075fe7351af5d87016cc32R4) As a workaround - introduced a nullish check. We ran...
2022-12-27T17:27:09Z
1.11
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/objectSupport.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
2,231
iamkun__dayjs-2231
[ "2230" ]
e70bee7f840c89ec523b9ac997e5ac621a522726
diff --git a/src/index.js b/src/index.js --- a/src/index.js +++ b/src/index.js @@ -280,7 +280,7 @@ class Dayjs { const matches = { YY: String(this.$y).slice(-2), - YYYY: this.$y, + YYYY: Utils.s(this.$y, 4, '0'), M: $M + 1, MM: Utils.s($M + 1, 2, '0'), MMM: getShort(locale.m...
diff --git a/test/display.test.js b/test/display.test.js --- a/test/display.test.js +++ b/test/display.test.js @@ -260,3 +260,15 @@ it('As JSON -> toJSON', () => { it('As ISO 8601 String -> toISOString e.g. 2013-02-04T22:44:30.652Z', () => { expect(dayjs().toISOString()).toBe(moment().toISOString()) }) + +it('Year...
'YYYY' results in missing leading zeroes when year <1000 **Describe the bug** If the year component of a date is less than 1000, the leading zeroes are omitted when trying to format the year with `'YYYY'`. E.g.: ```js dayjs(Date.parse('0001-01-01')).format('YYYY-MM-DD') //=> '1-01-01' dayjs(Date.parse('0010-01...
2023-02-07T09:19:20Z
1.11
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/display.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
2,360
iamkun__dayjs-2360
[ "2277" ]
b3624de619d6e734cd0ffdbbd3502185041c1b60
diff --git a/src/index.js b/src/index.js --- a/src/index.js +++ b/src/index.js @@ -278,34 +278,63 @@ class Dayjs { return isLowercase ? m.toLowerCase() : m }) - const matches = { - YY: String(this.$y).slice(-2), - YYYY: Utils.s(this.$y, 4, '0'), - M: $M + 1, - MM: Utils.s($M + 1, 2,...
diff --git a/test/display.test.js b/test/display.test.js --- a/test/display.test.js +++ b/test/display.test.js @@ -264,11 +264,7 @@ it('As ISO 8601 String -> toISOString e.g. 2013-02-04T22:44:30.652Z', () => { it('Year 1 formatted with YYYY should pad with zeroes', () => { const date = new Date(1, 0, 1) date.set...
objectSupport plugin causes an error when null is passed to dayjs function **Describe the bug** There is an bug, which causes an error `Cannot read properties of null (reading 'constructor')` when null is passed to dayjs function while objectSupport plugin is enabled e.g. `dayjs(null)` **Expected behavior** dayjs ...
ref: c9370ea96bf420439ee7eaa4146e8ed643160312 PR opened at https://github.com/iamkun/dayjs/pull/2342 Ping @iamkun please merge/release with semver patch, thank you 🙏
2023-06-30T17:53:50Z
1.11
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)", "test/display.test.js" ]
[ "test/plugin/minMax.test.js", "test/plugin/duration.test.js", "test/plugin/objectSupport.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
2,367
iamkun__dayjs-2367
[ "2366" ]
1fe1b1d9a214d3b8c9f267b432801424a493f1c4
diff --git a/src/plugin/duration/index.js b/src/plugin/duration/index.js --- a/src/plugin/duration/index.js +++ b/src/plugin/duration/index.js @@ -139,7 +139,7 @@ class Duration { let seconds = this.$d.seconds || 0 if (this.$d.milliseconds) { - seconds += this.$d.milliseconds / 1000 + seconds += M...
diff --git a/test/plugin/duration.test.js b/test/plugin/duration.test.js --- a/test/plugin/duration.test.js +++ b/test/plugin/duration.test.js @@ -70,6 +70,13 @@ describe('Creating', () => { it('convert to milliseconds', () => { expect(+dayjs.duration(100)).toBe(100) }) + it('handles rounding to millisecond...
`Duration.toISOString()` should use a set precision for seconds **Describe the bug** Problem: The `Duration.toISOString()` will format an ISO string with arbitrary precision floating point seconds. Although the specification doesn't define the precision the seconds field [should have](https://en.wikipedia.org/wiki/I...
2023-07-04T03:55:05Z
1.11
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/duration.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
2,369
iamkun__dayjs-2369
[ "2364" ]
f0a0b546b074b3b511c2319a1ce83d412894b91f
diff --git a/src/plugin/duration/index.js b/src/plugin/duration/index.js --- a/src/plugin/duration/index.js +++ b/src/plugin/duration/index.js @@ -198,7 +198,7 @@ class Duration { } else { base = this.$d[pUnit] } - return base === 0 ? 0 : base // a === 0 will be true on both 0 and -0 + return bas...
diff --git a/test/plugin/duration.test.js b/test/plugin/duration.test.js --- a/test/plugin/duration.test.js +++ b/test/plugin/duration.test.js @@ -186,6 +186,12 @@ describe('Add', () => { expect(a.add({ days: 5 }).days()).toBe(6) }) +describe('Add to a dayjs()', () => { + const a = dayjs() + const b = dayjs.dur...
dayjs add duration returns Invalid Date **Describe the bug** dayjs().add(dayjs.duration({ "hours" : 7, "minutes" : 10) })) returns "invalid Date" only "hours" and "minutes" are in the duration object dayjs.duration(7, "hours").add(10, "minutes") is working **Information** - Day.js Version 1.11.9 - Tim...
Can reproduce after upgrading from 1.11.7 to 1.11.9. Example usage ``` dayjs.extend(duration) dayjs.extend(utc) dayjs.extend(objectSupport) // Invalid Date dayjs.utc({ hours: 11, minutes: 30, seconds: 0} ).add(dayjs.duration({ hours: 11, minutes: 0, seconds: 0 }) ``` I've used `dayjs().add(duration.asSec...
2023-07-10T12:49:23Z
1.11
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/duration.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
2,377
iamkun__dayjs-2377
[ "2376" ]
f0a0b546b074b3b511c2319a1ce83d412894b91f
diff --git a/src/plugin/duration/index.js b/src/plugin/duration/index.js --- a/src/plugin/duration/index.js +++ b/src/plugin/duration/index.js @@ -139,7 +139,8 @@ class Duration { let seconds = this.$d.seconds || 0 if (this.$d.milliseconds) { - seconds += Math.round(this.$d.milliseconds) / 1000 + ...
diff --git a/test/plugin/duration.test.js b/test/plugin/duration.test.js --- a/test/plugin/duration.test.js +++ b/test/plugin/duration.test.js @@ -77,6 +77,15 @@ describe('Creating', () => { expect(dayjs.duration(1000.5).toISOString()).toBe('PT1.001S') expect(dayjs.duration(-1000.5).toISOString()).toBe('-PT1S...
`Duration.toISOString()` fractional seconds still have precision issues with certain values Problem: originally submitted in #2366 - I didn't completely fix this apparently. I mistakenly assumed I could round the milliseconds value alone, and then add it to the integer of seconds. However Javascript will encounter floa...
2023-07-14T19:51:39Z
1.11
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/duration.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
2,420
iamkun__dayjs-2420
[ "2398" ]
a9d7d0398d22ebd4bfc3812ca0134a97606d54d9
diff --git a/src/plugin/timezone/index.js b/src/plugin/timezone/index.js --- a/src/plugin/timezone/index.js +++ b/src/plugin/timezone/index.js @@ -97,7 +97,7 @@ export default (o, c, d) => { const date = this.toDate() const target = date.toLocaleString('en-US', { timeZone: timezone }) const diff = Math.r...
diff --git a/test/plugin/timezone.test.js b/test/plugin/timezone.test.js --- a/test/plugin/timezone.test.js +++ b/test/plugin/timezone.test.js @@ -318,4 +318,15 @@ describe('startOf and endOf', () => { const endOfDay = originalDay.endOf('day') expect(endOfDay.valueOf()).toEqual(originalDay.valueOf()) }) + ...
Calling tz() overrides locale Running `dayjs('2020-01-08T15:14:59.741774+00:00') .locale('es') .tz('America/New_York') .format('LLL')` gives `January 8, 2020 10:14 AM` instead of `8 de enero de 2020 10:14`. However, switching the order of `locale` and `tz`, e.g. `dayjs('2020-01-08...
I think this issue(#2248) should be checked.
2023-08-21T22:25:32Z
1.11
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/timezone.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
2,532
iamkun__dayjs-2532
[ "2248" ]
f4cb2cfd77246116cb4151c74ca2f600a17cd951
diff --git a/src/index.js b/src/index.js --- a/src/index.js +++ b/src/index.js @@ -50,7 +50,7 @@ const dayjs = function (date, c) { const wrapper = (date, instance) => dayjs(date, { locale: instance.$L, - utc: instance.$u, + utc: instance.$offset !== 0 && instance.$u, x: instance.$x, $offset: i...
diff --git a/test/timezone.test.js b/test/timezone.test.js --- a/test/timezone.test.js +++ b/test/timezone.test.js @@ -3,6 +3,7 @@ import moment from 'moment' import dayjs from '../src' import timezone from '../src/plugin/timezone' import utc from '../src/plugin/utc' +import '../src/locale/en' dayjs.extend(utc) ...
Having some issues when use a timezone with zero offset with locale method # I'm having some issues with parsing timezones with zero offsets. ## Issue description I have unexpected results when applying locale for the `dayjs` object in UTC and timezone with zero offsets. When I call the `locale` method after `.tz()...
+1 @iamkun Do you know this issue?
2023-12-20T02:41:14Z
1.11
[]
[ "test/timezone.test.js(1)" ]
JavaScript
[ "https://user-images.githubusercontent.com/44264841/221544237-5f87fbed-1d1d-46ec-86c7-57c8bd22954c.png", "https://user-images.githubusercontent.com/44264841/221547272-b646b734-4049-4858-b2ae-88d4f40e2897.png", "https://user-images.githubusercontent.com/44264841/221547356-2aee1b03-90e3-4560-9eb6-3f22f1f7f173.png...
[]
iamkun/dayjs
483
iamkun__dayjs-483
[ "484" ]
69d5d4796f9e539556ab7353c221e09b08853052
diff --git a/src/locale/en-gb.js b/src/locale/en-gb.js new file mode 100644 --- /dev/null +++ b/src/locale/en-gb.js @@ -0,0 +1,43 @@ +import dayjs from 'dayjs' + +const locale = { + name: 'en-gb', + weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), + weekdaysShort: 'Sun_Mon_Tue_Wed_Thu...
diff --git a/test/locale/keys.test.js b/test/locale/keys.test.js --- a/test/locale/keys.test.js +++ b/test/locale/keys.test.js @@ -36,8 +36,9 @@ it('Locale keys', () => { expect(months).toEqual(expect.any(Array)) // function pass date return string or number or null - expect(ordinal(1)).toEqual(expect.an...
parse hours and minutes 12:00 require('daysjs')('12:00', 'hh:mm') => Invalid Date require('moment')('12:00', 'hh:mm') => "2019-02-07T12:00:00.000"
2019-02-07T13:19:17Z
1.8
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/locale/keys.test.js" ]
[ "test/plugin/customParseFormat.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
495
iamkun__dayjs-495
[ "494" ]
f2514935eb83522306bc68f303db2923ed150ee8
diff --git a/prettier.config.js b/prettier.config.js new file mode 100644 --- /dev/null +++ b/prettier.config.js @@ -0,0 +1,7 @@ +module.exports = { + useTabs: false, + printWidth: 80, + singleQuote: true, + trailingComma: 'none', + semi: false +} diff --git a/src/constant.js b/src/constant.js --- a/src/constant.j...
diff --git a/test/locale/keys.test.js b/test/locale/keys.test.js --- a/test/locale/keys.test.js +++ b/test/locale/keys.test.js @@ -36,9 +36,12 @@ it('Locale keys', () => { expect(months).toEqual(expect.any(Array)) // function pass date return string or number or null - for (let i = 1; i <= 31; i += 1) { ...
Custom format creating wrong date Parsing the date `31/01/2019` (pt-br style) using `dayjs_plugin_customParseFormat` is creating a wrong date. ```js dayjs.extend(dayjs_plugin_customParseFormat); dayjs('31/01/2019', 'DD/MM/YYYY') // => 2019-03-03T00:00:00-03:00 ``` <https://jsfiddle.net/dpb4hfnk/>
2019-02-14T03:30:22Z
1.8
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/locale/keys.test.js" ]
[ "test/plugin/customParseFormat.test.js", "test/manipulate.test.js", "test/plugin/isBetween.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
510
iamkun__dayjs-510
[ "501" ]
0477f8c703bff550bd9e15f3fca6226826bdc201
diff --git a/.babelrc b/babel.config.js similarity index 87% rename from .babelrc rename to babel.config.js --- a/.babelrc +++ b/babel.config.js @@ -1,20 +1,20 @@ -{ - "env": { - "test": { - "presets": [ - "@babel/preset-env" - ] - }, - "build": { - "presets": [ - [ - "@b...
diff --git a/test/index.d.test.ts b/test/index.d.test.ts deleted file mode 100644 --- a/test/index.d.test.ts +++ /dev/null @@ -1,79 +0,0 @@ -import dayjs from '../src' - -dayjs() - -dayjs('1993-03-1') - -dayjs(730944000000) - -dayjs(new Date(1993, 3, 1)) - -dayjs().clone() - -dayjs().isValid() - -dayjs().year() - -dayj...
Cannot read property 'relativeTime' of undefined Getting the following error: ``` Uncaught TypeError: Cannot read property 'relativeTime' of undefined at fromTo (index.js:21) at Dayjs.push../node_modules/dayjs/esm/plugin/relativeTime/index.js.__webpack_exports__.default.proto.from (index.js:89) at Mo...
2019-02-23T19:09:53Z
1.8
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/parse.test.js", "test/manipulate.test.js" ]
[ "test/plugin/declarations.test.js", "test/plugin/customParseFormat.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
517
iamkun__dayjs-517
[ "497" ]
5fc05a6897dfcf32e0151d754445ca48440adab8
diff --git a/src/index.js b/src/index.js --- a/src/index.js +++ b/src/index.js @@ -38,20 +38,25 @@ const dayjs = (date, c, pl) => { return new Dayjs(cfg) // eslint-disable-line no-use-before-define } -const wrapper = (date, instance) => dayjs(date, { locale: instance.$L }) +const wrapper = (date, instance) => day...
diff --git a/test/plugin.test.js b/test/plugin.test.js --- a/test/plugin.test.js +++ b/test/plugin.test.js @@ -30,5 +30,6 @@ it('Plugin extend dayjs', () => { }) it('Plugin use core utils', () => { - expect(dayjs().$utils().isUndefined).toBeInstanceOf(Function) + // u => isUndefined + expect(dayjs().$utils().u)....
Unix timestamp is incorrect? `if (new Date().getTimezoneOffset() === 0)` then `dayjs.unix(1550251173).startOf('day').unix()` returns `1550188800`. `if (new Date().getTimezoneOffset() === 300)` then `dayjs.unix(1550251173).startOf('day').unix()` returns `1550206800`. A Unix timestamp is by definition a count of se...
Because in `dayjs.unix(1550251173)`, dayjs parses and displays in local time. The same in momentjs. Yes, that should parse into local time. But the final conversion _back_ to a Unix timestamp should generate a number at UTC. Yes, and that will be of course different. Cause `startOf('day')` is different. What do you no...
2019-03-06T07:52:35Z
1.8
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)" ]
[ "test/utils.test.js", "test/plugin/utc.test.js", "test/plugin.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
539
iamkun__dayjs-539
[ "531" ]
6e29a4aa793d48cc57635da6a19ef227fbe3e3b5
diff --git a/src/locale/az.js b/src/locale/az.js new file mode 100644 --- /dev/null +++ b/src/locale/az.js @@ -0,0 +1,39 @@ +import dayjs from 'dayjs' + +const locale = { + name: 'az', + weekdays: 'Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə'.split('_'), + weekdaysShort: 'Baz_BzE_ÇAx_Çər_CAx_C...
diff --git a/test/plugin/customParseFormat.test.js b/test/plugin/customParseFormat.test.js --- a/test/plugin/customParseFormat.test.js +++ b/test/plugin/customParseFormat.test.js @@ -26,6 +26,12 @@ it('parse padded string', () => { expect(dayjs(input, format).valueOf()).toBe(moment(input, format).valueOf()) }) +i...
Typescript definition allows `quarter` as unit of time **Describe the bug** According to the typescript definition, this is valid: ```ts val now = dayjs() val nextQuarter = now.add(1, 'quarter') now.valueOf() == nextQuarter.valueOf() // true ``` **Expected behavior** Either the quarter calculation shoul...
Thanks, will fix soon
2019-03-21T04:40:34Z
1.8
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)" ]
[ "test/utils.test.js", "test/plugin/quarterOfYear.test.js", "test/plugin/customParseFormat.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
556
iamkun__dayjs-556
[ "554" ]
566873acbdb562ff6354d255579eb323777d86f2
diff --git a/src/plugin/advancedFormat/index.js b/src/plugin/advancedFormat/index.js --- a/src/plugin/advancedFormat/index.js +++ b/src/plugin/advancedFormat/index.js @@ -13,7 +13,7 @@ export default (o, c, d) => { // locale needed later const locale = this.$locale() const utils = this.$utils() const str...
diff --git a/test/plugin/advancedFormat.test.js b/test/plugin/advancedFormat.test.js --- a/test/plugin/advancedFormat.test.js +++ b/test/plugin/advancedFormat.test.js @@ -82,3 +82,14 @@ it('Format Week Year gggg', () => { const d = '2018-12-31' expect(dayjs(d).format('gggg')).toBe(moment(d).format('gggg')) }) + ...
avancedFormat plugin is interpolating content inside square brackets **Describe the bug** advancedFormat and buddhistEra plugins are changing/interpolating content inside square brackets ```javascript // with advancedFormat const dayJSformat = dayjs.format('[Saturday]') // outputs: outputs something like "1418400...
I'll submit a pr for this (and some other plugins with the same behavior) My test-cases and fix for #550 didn't cover this one too.
2019-04-02T14:01:42Z
1.8
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)" ]
[ "test/plugin/buddhistEra.test.js", "test/plugin/advancedFormat.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
569
iamkun__dayjs-569
[ "559" ]
ffffacffd02132aefa0ed811092a02eb7f80d10f
diff --git a/src/plugin/weekday/index.js b/src/plugin/weekday/index.js new file mode 100644 --- /dev/null +++ b/src/plugin/weekday/index.js @@ -0,0 +1,13 @@ +export default (o, c) => { + const proto = c.prototype + proto.weekday = function (input) { + const weekStart = this.$locale().weekStart || 0 + const { $W...
diff --git a/test/plugin/weekday.test.js b/test/plugin/weekday.test.js new file mode 100644 --- /dev/null +++ b/test/plugin/weekday.test.js @@ -0,0 +1,43 @@ +import MockDate from 'mockdate' +import moment from 'moment' +import dayjs from '../../src' +import weekday from '../../src/plugin/weekday' +import '../../src/loc...
moment.weekday() alternative function I'm trying to migrate from moment to dayJS and currently there is no alternative for [moement.weekday()](https://momentjs.com/docs/#/get-set/weekday/). As far as I understand it is a locale aware version of `day()` which already exists in dayjs. gitter convo with maintainer: ...
2019-04-15T04:18:38Z
1.8
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)" ]
[ "test/plugin/weekday.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
581
iamkun__dayjs-581
[ "577" ]
927971884f21bd973246999abb82830b865411d0
diff --git a/src/index.js b/src/index.js --- a/src/index.js +++ b/src/index.js @@ -278,14 +278,15 @@ class Dayjs { const str = formatStr || C.FORMAT_DEFAULT const zoneStr = Utils.z(this) const locale = this.$locale() + const { $H, $m, $M } = this const { weekdays, months, meridiem } =...
diff --git a/test/locale/keys.test.js b/test/locale/keys.test.js --- a/test/locale/keys.test.js +++ b/test/locale/keys.test.js @@ -35,11 +35,23 @@ Locale.forEach((locale) => { expect(weekdays).toEqual(expect.any(Array)) if (weekdaysShort) expect(weekdaysShort).toEqual(expect.any(Array)) - if (monthsShort...
Please fix formatting months in russian <!-- Issuehunt Badges --> [<img alt="Issuehunt badges" src="https://img.shields.io/badge/IssueHunt-%2450%20Rewarded-%237E24E3.svg" />](https://issuehunt.io/r/iamkun/dayjs/issues/577) <!-- /Issuehunt Badges --> **Describe the bug** Long description of months (MMMM) are showing ...
This might be a breaking change of Day.js. After searching: > In this example, in Russian language a stand-alone month is in the nominative case ("январь"), and formatting month is in the genitive case ("января" as in "1-е января"). Notice the different endings: That is to say we should add two different for...
2019-04-26T07:30:02Z
1.8
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/locale/keys.test.js" ]
[ "test/locale/ru.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
591
iamkun__dayjs-591
[ "587" ]
de14682fa5e5815d73ae3d377b499321648c20ba
diff --git a/src/plugin/quarterOfYear/index.js b/src/plugin/quarterOfYear/index.js --- a/src/plugin/quarterOfYear/index.js +++ b/src/plugin/quarterOfYear/index.js @@ -4,7 +4,7 @@ export default (o, c) => { const proto = c.prototype proto.quarter = function (quarter) { if (!this.$utils().u(quarter)) { - ...
diff --git a/test/plugin/quarterOfYear.test.js b/test/plugin/quarterOfYear.test.js --- a/test/plugin/quarterOfYear.test.js +++ b/test/plugin/quarterOfYear.test.js @@ -31,6 +31,9 @@ it('set QuarterOfYear', () => { const d2 = '2013-02-05T05:06:07.000' expect(dayjs(d2).quarter(2).format()) .toBe(moment(d2).quar...
quarter() difference from Moment <!-- Issuehunt Badges --> [<img alt="Issuehunt badges" src="https://img.shields.io/badge/IssueHunt-%24100%20Rewarded-%237E24E3.svg" />](https://issuehunt.io/r/iamkun/dayjs/issues/587) <!-- /Issuehunt Badges --> **Describe the bug** My assumption is that `quarter(value)` works identic...
This is a bug. It should be the same. Checking ...
2019-05-07T14:17:47Z
1.8
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)" ]
[ "test/plugin/quarterOfYear.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
602
iamkun__dayjs-602
[ "601" ]
1761ebab0fbba36e401624379289e3777312d9b1
diff --git a/src/index.js b/src/index.js --- a/src/index.js +++ b/src/index.js @@ -10,7 +10,7 @@ const isDayjs = d => d instanceof Dayjs // eslint-disable-line no-use-before-def const parseLocale = (preset, object, isLocal) => { let l - if (!preset) return null + if (!preset) return L if (typeof preset === '...
diff --git a/test/locale.test.js b/test/locale.test.js --- a/test/locale.test.js +++ b/test/locale.test.js @@ -110,4 +110,14 @@ describe('Instance locale inheritance', () => { expect(esDayjs.add(1, 'minute').format(format)) .toBe('sábado 28, Abril') }) + + it('dayjs.locale() returns locale name', () => ...
.locale method should returns current locale <!-- Issuehunt Badges --> [<img alt="Issuehunt badges" src="https://img.shields.io/badge/IssueHunt-%24100%20Rewarded-%237E24E3.svg" />](https://issuehunt.io/r/iamkun/dayjs/issues/601) <!-- /Issuehunt Badges --> **Describe the bug** ``` dayjs.locale() ``` should retur...
2019-05-21T15:38:57Z
1.8
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/localeData.test.js", "test/locale.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
658
iamkun__dayjs-658
[ "650" ]
95e70b41e3be6882b0d2ba6c06aa8ad767873024
diff --git a/src/plugin/weekOfYear/index.js b/src/plugin/weekOfYear/index.js --- a/src/plugin/weekOfYear/index.js +++ b/src/plugin/weekOfYear/index.js @@ -6,13 +6,22 @@ export default (o, c, d) => { if (week !== null) { return this.add((week - this.week()) * 7, 'day') } + + const weekStart = this.$l...
diff --git a/test/plugin/weekOfYear.test.js b/test/plugin/weekOfYear.test.js --- a/test/plugin/weekOfYear.test.js +++ b/test/plugin/weekOfYear.test.js @@ -2,6 +2,7 @@ import moment from 'moment' import MockDate from 'mockdate' import dayjs from '../../src' import weekOfYear from '../../src/plugin/weekOfYear' +import...
expect(dayjs('2019-07-28').week()).toBe(30) **Describe the bug** Since the introduction of `locale.weekStart` I expect it to work with e.g `.week()` plugin, but currently it doesn't. 2019-07-28 is Sunday, so in `en-gb` locale it should be part of week 30, not week 31. In Jest syntax: ```javascript require('dayjs/...
I _almost_ found a solution by changing one line: ```typescript // before const compareDay = startOfYear.subtract(startOfYear.day(), 'd').subtract(1, 'ms') // after const compareDay = startOfYear.subtract(startOfYear.day() - weekStart, 'd').subtract(1, 'ms') // const weekStart = (this as any).$locale().weekStar...
2019-08-13T08:39:25Z
1.8
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/weekOfYear.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
668
iamkun__dayjs-668
[ "620" ]
4c862f682e763c5ad27ebc2492f7a40d0030ea4f
diff --git a/src/index.js b/src/index.js --- a/src/index.js +++ b/src/index.js @@ -38,7 +38,8 @@ const dayjs = (date, c, pl) => { return new Dayjs(cfg) // eslint-disable-line no-use-before-define } -const wrapper = (date, instance) => dayjs(date, { locale: instance.$L, utc: instance.$u }) +const wrapper = (date, ...
diff --git a/test/plugin/utc-utcOffset.test.js b/test/plugin/utc-utcOffset.test.js new file mode 100644 --- /dev/null +++ b/test/plugin/utc-utcOffset.test.js @@ -0,0 +1,77 @@ +import MockDate from 'mockdate' +import moment from 'moment' +import dayjs from '../../src' +import utc from '../../src/plugin/utc' + +dayjs.ext...
Setting UTCOffset <!-- Issuehunt Badges --> [<img alt="Issuehunt badges" src="https://img.shields.io/badge/IssueHunt-%24100%20Rewarded-%237E24E3.svg" />](https://issuehunt.io/r/iamkun/dayjs/issues/620) <!-- /Issuehunt Badges --> I'm currently converting from `moment.js`, and was curious how to set the value of `utcOf...
2019-08-27T06:26:52Z
1.8
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/utc-utcOffset.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
678
iamkun__dayjs-678
[ "676" ]
88778838e71dd309e79cd1a8094d5bea36ca3390
diff --git a/src/plugin/advancedFormat/index.js b/src/plugin/advancedFormat/index.js --- a/src/plugin/advancedFormat/index.js +++ b/src/plugin/advancedFormat/index.js @@ -13,7 +13,7 @@ export default (o, c, d) => { // locale needed later const locale = this.$locale() const utils = this.$utils() const str...
diff --git a/test/plugin/weekOfYear.test.js b/test/plugin/weekOfYear.test.js --- a/test/plugin/weekOfYear.test.js +++ b/test/plugin/weekOfYear.test.js @@ -2,8 +2,10 @@ import moment from 'moment' import MockDate from 'mockdate' import dayjs from '../../src' import weekOfYear from '../../src/plugin/weekOfYear' +impor...
dayjs().format('YYYY w Week') error result **Describe the bug** 使用dayjs().format('YYYY年第w周') 期望可以得到 2019年第29周 **Expected behavior** 使用dayjs().format('YYYY年第w周') 期望可以得到 2019年第29周,实际上却展示为2019年第w周 **Information** - Day.js 版本1.8.16 - OS: Linux - Browser chrome 74.0.3729.131 - Time zone: GMT+08:00
Bug confirmed. Current workaround ``` var dayjs = require("dayjs") var advancedFormat = require('dayjs/plugin/advancedFormat') var weekOfYear = require('dayjs/plugin/weekOfYear') dayjs.extend(advancedFormat) dayjs.extend(weekOfYear) dayjs().format('YYYY年第wo周') ```
2019-09-17T14:05:47Z
1.8
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/weekOfYear.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
719
iamkun__dayjs-719
[ "676" ]
7241da91aab31613e316dce72cd723c162d2b54e
diff --git a/src/index.js b/src/index.js --- a/src/index.js +++ b/src/index.js @@ -38,7 +38,12 @@ const dayjs = (date, c, pl) => { return new Dayjs(cfg) // eslint-disable-line no-use-before-define } -const wrapper = (date, instance) => dayjs(date, { locale: instance.$L, utc: instance.$u }) +const wrapper = (date,...
diff --git a/test/plugin/utc-utcOffset.test.js b/test/plugin/utc-utcOffset.test.js new file mode 100644 --- /dev/null +++ b/test/plugin/utc-utcOffset.test.js @@ -0,0 +1,103 @@ +import MockDate from 'mockdate' +import moment from 'moment' +import dayjs from '../../src' +import utc from '../../src/plugin/utc' + +dayjs.ex...
dayjs().format('YYYY w Week') error result **Describe the bug** 使用dayjs().format('YYYY年第w周') 期望可以得到 2019年第29周 **Expected behavior** 使用dayjs().format('YYYY年第w周') 期望可以得到 2019年第29周,实际上却展示为2019年第w周 **Information** - Day.js 版本1.8.16 - OS: Linux - Browser chrome 74.0.3729.131 - Time zone: GMT+08:00
2019-11-06T04:55:21Z
1.8
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/utc-utcOffset.test.js", "test/plugin/weekOfYear.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
734
iamkun__dayjs-734
[ "680" ]
9ad2e47e0569b23991bb0d5578f49c792c12df08
diff --git a/src/plugin/localeData/index.js b/src/plugin/localeData/index.js --- a/src/plugin/localeData/index.js +++ b/src/plugin/localeData/index.js @@ -17,7 +17,8 @@ export default (o, c, dayjs) => { // locale needed later weekdaysMin: instance => (instance ? instance.format('dd') : getShort(this, 'w...
diff --git a/test/plugin/localeData.test.js b/test/plugin/localeData.test.js --- a/test/plugin/localeData.test.js +++ b/test/plugin/localeData.test.js @@ -2,8 +2,10 @@ import MockDate from 'mockdate' import moment from 'moment' import dayjs from '../../src' import localeData from '../../src/plugin/localeData' +impor...
How to get the locale format? What is the equivalent of this moment code? `moment.localeData().longDateFormat('L')`
We will add it later to LocaleData plugin https://github.com/iamkun/dayjs/blob/dev/src/plugin/localeData/index.js You can get it in this way at the present ``` var dayjs = require("dayjs") var LocalizedFormat = require( 'dayjs/plugin/localizedFormat') dayjs.extend(LocalizedFormat) console.log(dayjs.Ls.en....
2019-11-15T04:01:06Z
1.8
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/plugin/localeData.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
745
iamkun__dayjs-745
[ "743" ]
15d1b813e7faf5a1f9d1ea6fc673fd27ac49d8b1
diff --git a/src/locale/sv.js b/src/locale/sv.js --- a/src/locale/sv.js +++ b/src/locale/sv.js @@ -11,7 +11,7 @@ const locale = { ordinal: (n) => { const b = n % 10 const o = (b === 1) || (b === 2) ? 'a' : 'e' - return `${n}${o}` + return `[${n}${o}]` }, formats: { LT: 'HH:mm',
diff --git a/test/locale/sv.test.js b/test/locale/sv.test.js new file mode 100644 --- /dev/null +++ b/test/locale/sv.test.js @@ -0,0 +1,21 @@ +import MockDate from 'mockdate' +import dayjs from '../../src' +import advancedFormat from '../../src/plugin/advancedFormat' +import '../../src/locale/sv' + +dayjs.extend(advanc...
Ordinal formatting in Swedish **Describe the bug** When using the format for ordinal numbers (`Do`) in Swedish the formatting is wrong for 1 and 2. It becomes `am` instead of `a`. This is likely because the date is formatted a second time, and `a` is formatted to be `am`. What happens: `> dayjs('2019-01-01').loca...
2019-12-08T18:43:54Z
1.8
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/locale/sv.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
754
iamkun__dayjs-754
[ "680" ]
579938380cd4402c7dbc91fcaa322aa3a5c5c1d7
diff --git a/src/index.js b/src/index.js --- a/src/index.js +++ b/src/index.js @@ -366,7 +366,8 @@ class Dayjs { locale(preset, object) { if (!preset) return this.$L const that = this.clone() - that.$L = parseLocale(preset, object, true) + const nextLocaleName = parseLocale(preset, object, true) + ...
diff --git a/test/locale.test.js b/test/locale.test.js --- a/test/locale.test.js +++ b/test/locale.test.js @@ -121,3 +121,12 @@ describe('Instance locale inheritance', () => { expect(dayjs.locale()).toBe(moment.locale()) }) }) + + +it('Not supported locale string fallback to previous one', () => { + const D =...
How to get the locale format? What is the equivalent of this moment code? `moment.localeData().longDateFormat('L')`
We will add it later to LocaleData plugin https://github.com/iamkun/dayjs/blob/dev/src/plugin/localeData/index.js You can get it in this way at the present ``` var dayjs = require("dayjs") var LocalizedFormat = require( 'dayjs/plugin/localizedFormat') dayjs.extend(LocalizedFormat) console.log(dayjs.Ls.en....
2019-12-18T06:08:48Z
1.8
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)" ]
[ "test/locale/sv.test.js", "test/locale/zh-cn.test.js", "test/locale.test.js", "test/plugin/localeData.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
768
iamkun__dayjs-768
[ "761" ]
6b587dabc13b06a73c6bec9b77ec8aca890ebf0a
diff --git a/src/locale/cs.js b/src/locale/cs.js --- a/src/locale/cs.js +++ b/src/locale/cs.js @@ -1,5 +1,52 @@ import dayjs from 'dayjs' +function plural(n) { + return (n > 1) && (n < 5) && (~~(n / 10) !== 1) // eslint-disable-line +} +/* eslint-disable */ +function translate(number, withoutSuffix, key, isFuture)...
diff --git a/test/locale/cs.test.js b/test/locale/cs.test.js new file mode 100644 --- /dev/null +++ b/test/locale/cs.test.js @@ -0,0 +1,52 @@ +import moment from 'moment' +import MockDate from 'mockdate' +import dayjs from '../../src' +import relativeTime from '../../src/plugin/relativeTime' +import '../../src/locale/c...
the result of dayjs("2019-02", "YYYY-MM") is wrong **Describe the bug** ``` import dayjs from "dayjs"; import customParseFormat from "dayjs/plugin/customParseFormat"; dayjs.extend(customParseFormat); 2019-02 dayjs format: {dayjs("2019-02", "YYYY-MM").format("YYYY-MM")} ``` result: `2019-03` expected: `2019-02...
2020-01-06T09:04:03Z
1.8
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)", "test/plugin/relativeTime.test.js" ]
[ "test/plugin/updateLocale.test.js", "test/locale/cs.test.js", "test/locale/uk.test.js", "test/locale/ru.test.js", "test/plugin/weekOfYear.test.js", "test/plugin/customParseFormat.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
769
iamkun__dayjs-769
[ "772" ]
731b9476f4a2f20c6cc89b4d6550edfff958b756
diff --git a/src/locale/en-gb.js b/src/locale/en-gb.js --- a/src/locale/en-gb.js +++ b/src/locale/en-gb.js @@ -8,6 +8,7 @@ const locale = { months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.spl...
diff --git a/test/locale/keys.test.js b/test/locale/keys.test.js --- a/test/locale/keys.test.js +++ b/test/locale/keys.test.js @@ -28,6 +28,7 @@ Locale.forEach((locale) => { monthsShort, weekdaysMin, weekStart, + yearStart, meridiem } = locale.content @@ -37,6 +38,7 @@ Locale.for...
weekOfYear `week` edge cases with 2015-12-28 and 2016-10-30 **Describe the bug** weekOfYear `week` edge cases do not match moment `week` calculations ``` expect(dayjs('2015-12-28').week()).toBe(moment('2015-12-28').week()) // dayjs: 1 , moment: 53 expect(dayjs('2016-10-30').week()).toBe(moment('2016-10-30').we...
2020-01-06T11:02:09Z
1.8
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)", "test/plugin/weekday.test.js", "test/locale/keys.test.js" ]
[ "test/plugin/weekOfYear.test.js" ]
JavaScript
[]
[]
iamkun/dayjs
793
iamkun__dayjs-793
[ "779" ]
731b9476f4a2f20c6cc89b4d6550edfff958b756
diff --git a/src/locale/af.js b/src/locale/af.js --- a/src/locale/af.js +++ b/src/locale/af.js @@ -1,3 +1,4 @@ +// Afrikaans [af] import dayjs from 'dayjs' const locale = { diff --git a/src/locale/ar-dz.js b/src/locale/ar-dz.js --- a/src/locale/ar-dz.js +++ b/src/locale/ar-dz.js @@ -1,3 +1,4 @@ +// Arabic (Algeria)...
diff --git a/test/locale/et.test.js b/test/locale/et.test.js new file mode 100644 --- /dev/null +++ b/test/locale/et.test.js @@ -0,0 +1,38 @@ +import moment from 'moment' +import MockDate from 'mockdate' +import dayjs from '../../src' +import relativeTime from '../../src/plugin/relativeTime' +import '../../src/locale/e...
Can't get the Days of the Week **Describe the bug** I should be able to get all the days of the week with `dayjs().weekdays()`. Sadly, that function doesn't exist. I even tried the weekday plugin, and still get nothing. Am i missing something; Below you will find the code ``` import dayjs from 'dayjs'; import ...
2020-02-04T10:53:13Z
1.8
[ "test/timezone.test.js(1)", "test/timezone.test.js(2)", "test/timezone.test.js(3)", "test/timezone.test.js(4)", "test/plugin/weekday.test.js", "test/locale/keys.test.js" ]
[ "test/locale/et.test.js", "test/plugin/localeData.test.js", "test/locale/pl.test.js", "test/plugin/weekOfYear.test.js" ]
JavaScript
[]
[]