Skip to content

Strange behaviour Calendar field #672

Discussion options

You must be logged in to vote

The date field is one of those fields that need extra help at times. JCB does nothing to model this field, it is all Joomla and if the outcome is not what you expected you should use the expert modeling option in the field to model the field yourself.

I have seen other developers face the same issue and they had very hard workarounds. But the expert modeling option gives you the ability to model the field before you save it and again when you retrieve it (if need be) from the database.

So this is what I used at times:

if (isset([[[field]]]) && ([[[field]]] != '0000-00-00 00:00:00') && ([[[field]]] != ''))
{
	[[[field]]] = JFactory::getDate([[[field]]])->toSql();
}

Then my field setup lo…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Llewellynvdm
Comment options

@marcorensch
Comment options

@marcorensch
Comment options

Answer selected by marcorensch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants