Skip to content

Commit f529a8c

Browse files
Project Name Input Improvement
- Will auto capitalize every word - Added some more css to the input to match the drop downs more
1 parent eb1db9c commit f529a8c

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ <h6>Subtopic</h6>
5252
<button id="addSubtopicButton" class="slim-button fas fa-plus"></button>
5353

5454
<h6>Project</h6>
55-
<input id="projectInput" type="text">
55+
<input id="projectInput" type="text" style="padding: 5px 7px;">
5656
</div>
5757
<div id="displayInputsDiv" style="display: none; grid-gap: 2px;">
5858
<div class="display-inputs">

src/timer.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ function formatTime(milliseconds){
6868
};
6969

7070
async function logTimeHandler(time){
71-
const result = await api.logTimeHandler({topicID: topicSelect_el.value, subtopicID: subtopicSelect_el.value, project: projectInput_el.value, time});
71+
const words = projectInput_el.value.split(' ');
72+
const formattedWords = words.map(word => capitalizeFirstLetter(word));
73+
const formattedName = formattedWords.join(' ');
74+
75+
const result = await api.logTimeHandler({topicID: topicSelect_el.value, subtopicID: subtopicSelect_el.value, project: formattedName, time});
7276
await getAllActiveTopics();
7377
await getAllActiveSubtopics();
7478
await populateSubtopicSelect(topicSelect_el.value);

0 commit comments

Comments
 (0)