Coder Social home page Coder Social logo

Comments (4)

juppees avatar juppees commented on June 6, 2024 1

You may try to omit the leading zero - this works at least for me. With a leading zero, the same error arrises.

from wekan.

C0rn3j avatar C0rn3j commented on June 6, 2024

You may try to omit the leading zero - this works at least for me. With a leading zero, the same error arrises.

Thanks for that workaround and nailing it down!

09:00 errors but 9:00 works just fine.

from wekan.

C0rn3j avatar C0rn3j commented on June 6, 2024

function adjustedTimeFormat() {
return moment
.localeData()
.longDateFormat('LT')
.replace(/HH/i, 'H');
}

'submit .edit-date'(evt) {
evt.preventDefault();
// if no time was given, init with 12:00
const time =
evt.target.time.value ||
moment(new Date().setHours(12, 0, 0)).format('LT');
const newTime = moment(time, adjustedTimeFormat(), true);
const newDate = moment(evt.target.date.value, 'L', true);
const dateString = `${evt.target.date.value} ${time}`;
const newCompleteDate = moment(
dateString,
`L ${adjustedTimeFormat()}`,
true,
);
if (!newTime.isValid()) {
this.error.set('invalid-time');
evt.target.time.focus();
}

Well it's here, but I am not 100% sure how to fix it.

from wekan.

C0rn3j avatar C0rn3j commented on June 6, 2024

This makes 9:00 be invalid instead, which is perhaps not ideal, but at least it corresponds to the HH:mm hint.

Side note, is there a way to add the variable that's problematic to the error output?

Invalid time: "9:00", expected HH:mm format would make the issue even more obvious.
I honestly did not understand at first that it was the TIME that was the problem, despite it saying so and even highlighting the form. I though the date could also be wrong somehow.

from wekan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.