Giter Club home page Giter Club logo

Comments (6)

creecros avatar creecros commented on July 24, 2024

Should be very easy. Change the input type, from "date" to "datetime-local" in the MetaHelper.

from metamagik.

alaner2k avatar alaner2k commented on July 24, 2024

Tks a lot for the direction / frankly I'm not a programmer thus I attempted to change the field "data_type" @ table "metadata_types" from DATE to DATETIME or DATETIME-LOCAL by PHPMyAdmin in the DB, but with no success...
Well hope the MetaHelper will help :-)

from metamagik.

creecros avatar creecros commented on July 24, 2024

This line, specifically

$html .= $this->helper->form->input('date', 'metamagikkey_' . $key, ['metamagikkey_' . $key => $value], $errors, $attributes, 'form-input-small');

from metamagik.

alaner2k avatar alaner2k commented on July 24, 2024

Lovely!!!
I managed to re-define the date to date&time :-)
same time I tried not just re-define but ADD the new format by copying the function renderDateField, unfortunately with no further success yet :-)
Anyway you assisted my a lot!!! Thank you again!

from metamagik.

creecros avatar creecros commented on July 24, 2024

If you want to add it, you would have to add the type as well, and add the option in the template. It wouldn't be hard, but there is more to it than meets the eye.

I could add it, but don't have a working server anymore, haven't played with kanboard in a while. So...i wouldn't be able to test it.

Try this:

Add the option here


By just adding a line for 'datetime' => 'Date Time'

Then copy the renderDateField function in the helper, but call it renderDateTimeField. Change to datetime-local like before.

Then in the renderMetaFields function of the helper, add an else if for the new datetime type, just copy the else if for date, and change date to datetime, and have it point to the new renderDateTimeField function, instead of renderDateField

} elseif ($setting['data_type'] == 'date') {
$html .= $this->renderDateField($key, isset($metadata[$key]) ? $metadata[$key] : "", $errors, $new_attributes);

I think that should do it, unless I'm forgetting something

from metamagik.

alaner2k avatar alaner2k commented on July 24, 2024

IT
WORKS
PERFECTLY
!
Thanks for your efforts!

from metamagik.

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.