creecros / MetaMagik

Custom Fields for Kanboard - Plugin MetaMagik
MIT License
98 stars 16 forks source link

Feature request #71

Closed samjunction closed 3 years ago

samjunction commented 3 years ago

Please add support for date time field

creecros commented 3 years ago

not sure when I can get around to it, but in the meantime, just change the input type of date to datetime-local in the helper file, line 47. that should do it. if it has no effect, try restarting your server before you make that determination.

https://github.com/creecros/MetaMagik/blob/7d0fa25ef7bed91fa848545b096f18769553593b/Helper/MetaHelper.php#L47

samjunction commented 3 years ago

Hi,

It worked fine.

Thanks a lot.

Sandeep.

On Mon, Aug 16, 2021 at 7:51 PM Craig Crosby @.***> wrote:

not sure when I can get around to it, but in the meantime, just change the input type of date to datetime-local in the helper file, line 47. that should do it. if it has no effect, try restarting your server before you make that determination.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/creecros/MetaMagik/issues/71#issuecomment-899890585, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALXWIQ4H4USQM4A5QDVTECDT5GQAZANCNFSM5CIH5H7A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

samjunction commented 3 years ago

Hi,

How to detect field type in meta_footers.php ? For example i want to apply date/time formatting to custom field of type date or date/time

Thanks, Sandeep

On Wed, Aug 18, 2021 at 11:52 AM Craig Crosby @.***> wrote:

Closed #71 https://github.com/creecros/MetaMagik/issues/71.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/creecros/MetaMagik/issues/71#event-5175738389, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALXWIQ4MWZIT4XPPSTRBC3LT5PJKPANCNFSM5CIH5H7A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

samjunction commented 3 years ago

Hi,

Please ignore. I found it. I was not looking it carefully.

Sandeep.

On Thu, Aug 19, 2021 at 1:04 PM Sandeep Mandviya @.***> wrote:

Hi,

How to detect field type in meta_footers.php ? For example i want to apply date/time formatting to custom field of type date or date/time

Thanks, Sandeep

On Wed, Aug 18, 2021 at 11:52 AM Craig Crosby @.***> wrote:

Closed #71 https://github.com/creecros/MetaMagik/issues/71.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/creecros/MetaMagik/issues/71#event-5175738389, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALXWIQ4MWZIT4XPPSTRBC3LT5PJKPANCNFSM5CIH5H7A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

samjunction commented 3 years ago

Hi,

I can use $custom_field['data_type'] to identify field type but not sure how to apply date/time formatting. I am not familiar with php.

Sandeep.

On Thu, Aug 19, 2021 at 1:05 PM Sandeep Mandviya @.***> wrote:

Hi,

Please ignore. I found it. I was not looking it carefully.

Sandeep.

On Thu, Aug 19, 2021 at 1:04 PM Sandeep Mandviya @.***> wrote:

Hi,

How to detect field type in meta_footers.php ? For example i want to apply date/time formatting to custom field of type date or date/time

Thanks, Sandeep

On Wed, Aug 18, 2021 at 11:52 AM Craig Crosby @.***> wrote:

Closed #71 https://github.com/creecros/MetaMagik/issues/71.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/creecros/MetaMagik/issues/71#event-5175738389, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALXWIQ4MWZIT4XPPSTRBC3LT5PJKPANCNFSM5CIH5H7A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

creecros commented 3 years ago

can you be specific, what do you mean by formatting? what are you trying to do?

creecros commented 3 years ago

actually I think I follow you.

I literally have no server to even test and look at things right now, so I can only guess here.

you seem to have successfully changed the input to date/time. now, you want the footer to show date/time? my guess is, it works on new things you have input, but not old fields when you had just date? if thats the case, the reason would be, because that information (time) was not stored in the database previously. if you update the value, it should now have that information to display. or, you would have to check the data, and if time isn't included in the stored value, display a generic time, like 00:00. The later could get complicated for you. I'm just guessing here. maybe you are trying to achieve something else.

also, you said you want to apply date/time formatting to both date and date/time. the problem with that is there is only date type. there aren't two types. you didn't create a second date type.

however, if you're goal is to apply a different formatting for date type in the footer, then just add an elseif for date, and then whatever...maybe change the class to something more specific and add some css. I have no idea what exactly you want to achieve to offer more.

example:

<?php elseif ($custom_field['data_type'] == 'date): ?>
                <span class="metamagik-footer-value-date"><?= $this->task->taskMetadataModel->get($task['id'], $custom_field['human_name'], '') ?></span>
samjunction commented 3 years ago

Hi,

I want to display custom field value of datatype date in mm/dd/yyyy hour:minute am/pm format.

Sandeep

On Fri, 20 Aug 2021 at 4:35 AM, Craig Crosby @.***> wrote:

actually I think I follow you.

I literally have no server to even test and look at things right now, so I can only guess here.

you seem to have successfully changed the input to date/time. now, you want the footer to show date/time? my guess is, it works on new things you have input, but not old fields when you had just date? if thats the case, the reason would be, because that information (time) was not stored in the database previously. if you update the value, it should now have that information to display. or, you would have to check the data, and if time isn't included in the stored value, display a generic time, like 00:00. The later could get complicated for you. I'm just guessing here. maybe you are trying to achieve something else.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/creecros/MetaMagik/issues/71#issuecomment-902308839, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALXWIQ6RI4ZBFVTE635ZN53T5WE33ANCNFSM5CIH5H7A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

creecros commented 3 years ago

can you screen shot what it currently shows

samjunction commented 3 years ago

Hi,

See attached screenshots. I managed to change the date/time format.

Sandeep.

On Fri, Aug 20, 2021 at 6:24 AM Craig Crosby @.***> wrote:

can you screen shot what it currently shows

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/creecros/MetaMagik/issues/71#issuecomment-902595047, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALXWIQ2AQPUPDSYIE5EU5DDT5YUM5ANCNFSM5CIH5H7A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .