0

I'm trying to remove the timestamp from the EE date fieldtype since for my application it isn't necessary. I need to be able to select two dates a start and end date that should be formatted like like this "%F %d %Y" and without any time stamping. I do need to also have a start and end time but they are not going to be the same as the current time the form is filled out as inserted by the date fieldtype. I plan on using dropdate for my start and end times but I first need to get these time stamps removed. I thought about having users just type the date in but the calendar selector is a nice feature to just ignore because of this time stamp. Is there anyway to accomplish the removal of the time stamp from the EE date fieldtype on EE 2.5.2? I'd rather not modify the core but willing to do so if I can achieve what I need, thanks in advance for any tips or suggestions!

3 Answers 3

1

Can you simply remove the timestamp after the fact with something like CE String?

Or, don't use the EE date field at all. Set up your own custom field, use a javscript calendar like jQuery UI Datepicker, and then you can format it exactly as you like.

1
  • Thanks for the reply Benek. I had thought of doing that too but the problem is when I remove the timestamp using jQuery I get an invalid date error on submit. Currently I'm looking for alternatives to the EE date fieldtype. Any other tips or suggestions would be greatly appreciated, thanks! Commented Jul 29, 2014 at 15:51
1

I came across this post while attempting to solve a similar problem; hopefully this will be helpful to others who need the same functionality in the future.

Event Helper is a plugin that comes with a field type that allows for a simple date formatting WITHOUT a time stamp that can be used in GRID and MATRIX.

The actual Event Helper extension still needs to be updated for the new EE version (I'm running 2.9.2) or it will create PHP errors, so I recommend installing ONLY the field type.

1
  • Thanks Paredes Creative for the comment and recommendation. I'll definitely check out the Event Helper plugin. Commented Jan 7, 2015 at 17:03
0

I was able to achieve this by setting the field to text then I created a new snippet with the following jQuery:

<script>
$(function() {
$( "#datepicker-one" ).datepicker(); 
});
$(function() {
$( "#datepicker-two" ).datepicker(); 
});
</script>

I added that snippet to the header of my template and then set the ID's on the fields to datepicker-one and datepicker-two worked out great.

However now I want to do the same thing but for a column within a Matrix field and my problem is there isn't the option to declare an ID for this field. Perhaps I could adjust this jQuery to use the name value instead of an ID but not I'm not exactly sure how to do that. Any suggestions on how to also get this functionality within a Matrix field would be greatly appreciated!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.