I wish to have a custom fieldtype which contains the standard datetime field abilities along with storing an extra piece of data. I have created a custom fieldtype for this with a mixed attributetype to store the data as JSON.
However I am having problems when I try to query some of the data from the frontend.
For example to pull out a specific piece of data I am currently doing:
variableName.date
This correctly pulls out the date I have stored. However when using this in the example:
craft.entries({ type: 'sectionName', customFieldtype.date: '>=' ~ now|date(c) }).order('customFieldtype.date asc').first()
I get errors as when Craft converts this to SQL it's converting these to column names and customFieldtype.date doesn't exist.
Is there any way around this bar having to re-create the built in craft entries calls in pure SQL?