Skip to content

Commit 07ecaec

Browse files
committed
Add source link
1 parent 1ca6ef8 commit 07ecaec

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

common/helpers/dayjs/__tests__/parseTime.spec.js

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import parseTime from '../parseTime'
44
import { padStart, range } from 'lodash-es'
55
import { HTML5_FMT } from '../../dateFormat'
66

7+
/**
8+
* Source: https://github.com/sbb-design-systems/sbb-angular/blob/24d4a804a55fa671cdf441a4556741ecfa2c638c/src/angular/time-input/time-input.spec.ts#L38
9+
*/
710
describe('parseTime', () => {
811
describe.each(Object.keys(dayjsLocaleMap))('`%s` locale', (locale) => {
912
beforeEach(() => {

common/helpers/dayjs/parseTime.js

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import dayjs from '../dayjs'
22
import { HTML5_FMT } from '../dateFormat'
33

4+
/**
5+
* Source: https://github.com/sbb-design-systems/sbb-angular/blob/24d4a804a55fa671cdf441a4556741ecfa2c638c/src/angular/time-input/time-input.ts
6+
*/
47
const REGEX_WITH_COLON = /([0-9]{1,2})[.:,\-;_hH]?([0-9]{1,2})?/
58
const REGEX_WITHOUT_COLON = /([0-9]{1,2})([0-9]{2})/
69

0 commit comments

Comments
 (0)