Duplicating data in date field

More
9 years 11 months ago #51417 by milind.purandare
Hi

I think I am missing something very simple.

I have created a flexi date field "MyDate"
When I create the flexi item, I select this date.

I have also created one more date field "MyCopiedDate"
I would like MyCopiedDate to get the value set for MyDate.

So if I choose MyDate = 10th Sep 2014 then MyCopiedDate should automatically get this date on saving.

I tried {{MyDate##0}} in Prefix etc in Field properties setting of MyCopiedDate but it is not showing.

I also tried making MyCopiedDate as a text field and set the "Default Value". It id not work. (it shows the abive {{MyDate##0}} instead of the value of that date.

I am sure I am missing something very simple.

Please guide.

Please Log in or Create an account to join the conversation.

More
9 years 11 months ago #51418 by milind.purandare
Ok! On my above post if I keep "MyCopiedDate" as a text field and put some value in "Default text" then the code for prefix / postfix etc works {{MyDate##0}} shows the date plus the default text with it.

Does not work for blank or spaces in default.

Ideally want to duplicate in date field
Else want to show as MM/YY in text field.

Please Log in or Create an account to join the conversation.

More
9 years 11 months ago #51420 by milind.purandare
ohh on above two posts i must clarify that the purpose of getting the "MyDate" into "MyworkingDate" is to show MyWorkingDate in DD/MM format as a filter for the category listing of the items. So the users can select items for a particular month/year.

Please Log in or Create an account to join the conversation.

More
9 years 11 months ago #51426 by ggppdk
Hello

a simple solution without hacking anything:

- you may duplicate the plugin
plugins/flexicontent/flexinotify.php

to make a new plugin

plugins/flexicontent/mycustom.php


and use the onAfterSaveItem event

to get values out of DB table for the 1 field

flexicontent_fields_item_relations

and copy them into the other field


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.357 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline