mirror of
https://github.com/wekan/wekan.git
synced 2025-12-22 02:10:12 +01:00
Reverted https://github.com/wekan/wekan/pull/5774 about due date changes.
Thanks to xet7 ! Fixes #5782
This commit is contained in:
parent
1979b1692d
commit
aaa5f9885d
3 changed files with 7 additions and 23 deletions
|
|
@ -83,8 +83,7 @@ export class DatePicker extends BlazeComponent {
|
|||
{
|
||||
'keyup .js-date-field'() {
|
||||
// parse for localized date format in strict mode
|
||||
const normalizedValue = Utils.normalizeDigits(this.find('#date').value);
|
||||
const dateMoment = moment(normalizedValue, 'L', true);
|
||||
const dateMoment = moment(this.find('#date').value, 'L', true);
|
||||
if (dateMoment.isValid()) {
|
||||
this.error.set('');
|
||||
this.$('.js-datepicker').datepicker('update', dateMoment.toDate());
|
||||
|
|
@ -92,10 +91,9 @@ export class DatePicker extends BlazeComponent {
|
|||
},
|
||||
'keyup .js-time-field'() {
|
||||
// parse for localized time format in strict mode
|
||||
const normalizedValue = Utils.normalizeDigits(this.find('#time').value);
|
||||
const dateMoment = moment(
|
||||
normalizedValue,
|
||||
adjustedTimeFormat(),
|
||||
this.find('#time').value,
|
||||
adjustedTimeFormat(),
|
||||
true,
|
||||
);
|
||||
if (dateMoment.isValid()) {
|
||||
|
|
@ -106,14 +104,12 @@ export class DatePicker extends BlazeComponent {
|
|||
evt.preventDefault();
|
||||
|
||||
// if no time was given, init with 12:00
|
||||
const timeValue = Utils.normalizeDigits(evt.target.time.value);
|
||||
const time =
|
||||
timeValue ||
|
||||
moment(new Date().setHours(12, 0, 0)).format('LT');
|
||||
evt.target.time.value ||
|
||||
moment(new Date().setHours(12, 0, 0)).format('LT');
|
||||
const newTime = moment(time, adjustedTimeFormat(), true);
|
||||
const dateValue = Utils.normalizeDigits(evt.target.date.value);
|
||||
const newDate = moment(dateValue, 'L', true);
|
||||
const dateString = `${dateValue} ${time}`;
|
||||
const newDate = moment(evt.target.date.value, 'L', true);
|
||||
const dateString = `${evt.target.date.value} ${time}`;
|
||||
const newCompleteDate = moment(
|
||||
dateString,
|
||||
`L ${adjustedTimeFormat()}`,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue