Skip to content

Commit

Permalink
Merge pull request #40 from nextmcloud/nmc/2656-date-formatting
Browse files Browse the repository at this point in the history
Share details tab - fix expiration date input
  • Loading branch information
memurats authored Jan 29, 2024
2 parents e5a0579 + 71c7926 commit 97e932d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/mixins/SharesMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ export default {
*/
onExpirationChange(date) {
try {
// Date.UTC marks years between 0 and 99 as '1900 + year' forcing error and incorrect date value
// thus we need to skip formatting while user is typing year in the input field
if (date.getFullYear() <= 99) return
this.share.expireDate = this.formatDateToString(new Date(date))
} catch (error) {}
},
Expand Down

0 comments on commit 97e932d

Please sign in to comment.