Skip to content

Commit 978eb8e

Browse files
committed
fix(datepicker): Fix typos
1 parent 124af71 commit 978eb8e

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/utils/DateUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ const utils = {
294294
if (typeof formatStr === 'function') {
295295
if (!parser || typeof parser !== 'function') {
296296
throw new Error(
297-
'Parser need to be a function if you are using a custom formatter',
297+
'Parser needs to be a function if you are using a custom formatter',
298298
)
299299
}
300300
return parser(dateStr)

src/utils/dom.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,19 +92,19 @@ export function getRelativePosition({
9292
setBottom()
9393
}
9494

95-
const hasRelativWidth =
95+
const hasRelativeWidth =
9696
documentWidth - relativeRect.left < targetWidth &&
9797
relativeRect.right < targetWidth
9898

99-
const hasRelativHeight =
99+
const hasRelativeHeight =
100100
relativeRect.top <= targetHeight &&
101101
documentHeight - relativeRect.bottom <= targetHeight
102102

103-
if (hasRelativWidth) {
103+
if (hasRelativeWidth) {
104104
left = offsetX - relativeRect.left + 1
105105
}
106106

107-
if (hasRelativHeight) {
107+
if (hasRelativeHeight) {
108108
top = offsetY + documentHeight - relativeRect.top - targetHeight
109109
}
110110
} else {

test/unit/specs/DateUtils.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ describe('dateUtils', () => {
107107
)
108108
})
109109

110-
it('should parse english dates', () => {
110+
it('should parse English dates', () => {
111111
expect(dateUtils.parseDate('16 April 2020', 'd MMMM yyyy')).toEqual(
112112
'2020-04-16T00:00:00',
113113
)
@@ -129,7 +129,7 @@ describe('dateUtils', () => {
129129
expect(() => {
130130
dateUtils.parseDate('16 April 2020', () => {})
131131
}).toThrowError(
132-
'Parser need to be a function if you are using a custom formatter',
132+
'Parser needs to be a function if you are using a custom formatter',
133133
)
134134
})
135135

test/unit/specs/Locale/Language.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ describe('Language class', () => {
77
expect(() => new Language(1, [], [], [])).toThrow(TypeError)
88
})
99

10-
it('should throw when there are not exacty 12 months', () => {
10+
it('should throw when there are not exactly 12 months', () => {
1111
expect(() => new Language('a', ['j', 'f', 'm'], months, days)).toThrow(
1212
RangeError,
1313
)
1414
})
1515

16-
it('should throw when there are not exacty 12 abbreviated months', () => {
16+
it('should throw when there are not exactly 12 abbreviated months', () => {
1717
expect(() => new Language('a', months, ['j', 'f', 'm'], days)).toThrow(
1818
RangeError,
1919
)
2020
})
2121

22-
it('should throw when there are not exacty 7 days', () => {
22+
it('should throw when there are not exactly 7 days', () => {
2323
expect(() => new Language('a', months, months, ['m', 't', 'w'])).toThrow(
2424
RangeError,
2525
)

0 commit comments

Comments
 (0)