Repository: Foundry376/Mailspring (language: javascript)

Issue:
Intuitive Time Parsing for Email Scheduling
## Objective

The objective of this task is to update the date parsing logic to handle both 3 and 4 digit time input strings for scheduling emails.
This will help interpret strings like "123" as "1:23" and "1234" as "12:34" as valid times.

## Testing Notes

## Tips

## References

Feature Proposal: [Intuitive Time Parsing for Email Scheduling - Mailspring Community](https://community.getmailspring.com/t/intuitive-time-parsing-for-email-scheduling/6991)



Discussion / hints:

Fix patch:
diff --git a/app/src/date-utils.ts b/app/src/date-utils.ts
index 741f6b7525..625b488b1a 100644
--- a/app/src/date-utils.ts
+++ b/app/src/date-utils.ts
@@ -131,6 +131,12 @@ function getChronoPast() {
 }
 
 function expandDateLikeString(dateLikeString: string) {
+  // Short format: 123 => 1:23 or 1234 => 12:34
+  if (/^\d{3,4}$/.test(dateLikeString)) {
+    const len = dateLikeString.length;
+    dateLikeString = dateLikeString.slice(0, len - 2) + ':' + dateLikeString.slice(len - 2); // Insert colon
+  }
+
   // Short format: 2h
   if (/^\d+h$/.test(dateLikeString)) {
     const numHours = dateLikeString.match(/^\d+/)[0]; // Extract number
@@ -309,7 +315,7 @@ const DateUtils = {
           results[val].month(month - 1); // moment zero-indexes month
           results[val].date(day);
 
-          if (!gotTime) {
+          if (!gotTime[val]) {
             results[val].hour(hour);
             results[val].minute(minute);
           }


Test patch: