-
Notifications
You must be signed in to change notification settings - Fork 842
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SuperDatePicker tweaks to make it selection more obvious (#2049)
- Fixed Absolute tab selection - Using bottom border to indicate which time period is selected - Added title to tab aria-labels - Added prepend labels to inputs for start/end - Also added `toSentenceCase` string service
- Loading branch information
Showing
10 changed files
with
87 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export { toInitials } from './to_initials'; | ||
export { toSentenceCase } from './to_case'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { toSentenceCase } from './to_case'; | ||
|
||
describe('toSentenceCase', () => { | ||
it("should return the same single word with the first letter capitalized for 'single'", () => { | ||
expect(toSentenceCase('single')).toBe('Single'); | ||
}); | ||
|
||
it("should return all the words with ony the first letter of the first word capitalized for 'two words'", () => { | ||
expect(toSentenceCase('two words')).toBe('Two words'); | ||
}); | ||
|
||
it("should return all the words with ony the first letter of the first word capitalized for 'opposite Of Sentence Case'", () => { | ||
expect(toSentenceCase('opposite Of Sentence Case')).toBe( | ||
'Opposite of sentence case' | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* This function returns the same string with the first letter of the first word capitalized. | ||
* | ||
* @param {string} strint The input string | ||
*/ | ||
|
||
export function toSentenceCase(string: string): string { | ||
// First lowercase all letters | ||
const lowercase = string.toLowerCase(); | ||
|
||
// Then just uppercase the first letter; | ||
return string.charAt(0).toUpperCase() + lowercase.slice(1); | ||
} |