Change date format

Home Forums Calendar Products Events Calendar PRO Change date format

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #927247
    samuel
    Participant

    Hi,

    Sorry for my English. I hope you understand me .
    (I use Google Traduction)

    I’ll try to explain my problem.
    I have a real issue about the date format.
    I installed the search bar on my home page.

    1 –

  • Here’s the code to integrate the search bar : (on the homepage)
  • <div id="tribe-events-bar">
    
    			<form id="tribe-bar-form" class="tribe-clearfix" name="tribe-bar-form" method="get" action="<?php bloginfo('url'); ?>/evenements/">
    
    				<!-- Mobile Filters Toggle -->
    
    				<div id="tribe-bar-collapse-toggle" <?php if ( count( $views ) == 1 ) { ?> class="tribe-bar-collapse-toggle-full-width"<?php } ?>>
    					<?php _e( 'Find Events', 'tribe-events-calendar' ) ?><span class="tribe-bar-toggle-arrow"></span>
    				</div>
    
    				<div class="tribe-bar-filters">
    					<div class="tribe-bar-filters-inner tribe-clearfix">
    							<div class="tribe-bar-date-filter">
    								<label for="tribe-bar-date" class="label-tribe-bar-date">Date</label>
    								<input type="text" placeholder="Date" value="" id="tribe-bar-date" data-date-format="mm-dd-yyyy" style="position: relative; z-index:10000" name="tribe-bar-date">
    								<input type="hidden" value="" class="tribe-no-param" id="tribe-bar-date-day" name="tribe-bar-date-day">								
    							</div>
    							<div class="tribe-bar-search-filter">
    								<label for="tribe-bar-search" class="label-tribe-bar-search">Search</label>
    								<input data-bind="label" type="text" placeholder="Snorkeling, Dinner Cruise, Ibiza Party" onfocus="this.placeholder = ''" onblur="this.placeholder = ''" value="" id="tribe-bar-search" name="tribe-bar-search">	
    
    							</div>
    						<div class="tribe-bar-submit">
    							<input class="tribe-events-button tribe-no-param" type="submit" name="submit-bar" value="<?php _e( 'Find Events', 'tribe-events-calendar' ) ?>" />
    						</div><!-- .tribe-bar-submit -->
    					</div><!-- .tribe-bar-filters-inner -->
    				</div><!-- .tribe-bar-filters -->
    
    			</form><!-- #tribe-bar-form -->
    
    </div><!-- #tribe-events-bar -->

    2 –

  • And here the code (in fucntions.php)
  • (According to Greg)

    //Add these scripts to only the front page
    function tribehome_enqueue_front_page_scripts() {
        if( is_front_page() )
        {
    	   
    	    //Add the stylesheet into the header
    		wp_enqueue_style("tribe.homepage",WP_PLUGIN_URL."/the-events-calendar/resources/tribe-events-full.css");
    		
    		wp_enqueue_style("tribe.homepage.date",WP_PLUGIN_URL."/the-events-calendar/vendor/bootstrap-datepicker/css/datepicker.css");
    		wp_enqueue_style("tribe.homepage.date",WP_PLUGIN_URL."/the-events-calendar/vendor/bootstrap-datepicker/css/datepicker3.css");
    		
    		//Add the scripts in the footer
    		wp_enqueue_script("jquery");
    		
    		wp_enqueue_script(
    		"tribe.homepage.bar", WP_PLUGIN_URL."/the-events-calendar/resources/tribe-events-bar.js",
    		array("jquery"), "1.3.1",1);
    		
    		wp_enqueue_script(
    		"tribe.homepage.events", WP_PLUGIN_URL."/the-events-calendar/resources/tribe-events.js",
    		array("jquery"), "1.3.1",1);
    		
    		wp_enqueue_script(
    		"tribe.homepage.datepicker", WP_PLUGIN_URL."/tribe-homepage-search/js/bootstrap-datepicker.js",
    		array("jquery"), "1.3.1",1);
    		
    		wp_enqueue_script(
    		"tribe.homepage.footer", WP_PLUGIN_URL."/tribe-homepage-search/js/footer.js",
    		array("jquery"), "1.3.1",1);
    
    	}
    }
    add_action( 'wp_enqueue_scripts', 'tribehome_enqueue_front_page_scripts' );

    No integration problem, but rather a problem when I decide to change the date format.
    I want to change the format “mm-dd-yyyy” to “dd-mm-yyyy”
    I changed this line ( on my home page):
    <input type="text" placeholder="Date" value="" id="tribe-bar-date" data-date-format="<strong>mm-dd-yyyy</strong>" style="position: relative; z-index:10000" name="tribe-bar-date">

  • Here is the result ! :
  • Capture 1

    Capture 2

    The search is done correctly , but the display of the date is wrong.
    “12-07-2016” instead of “31-12-2014”

  • Here are some screenshots:
  • Screenshot WP- 1

    Screenshot-WP- 2

    Screenshot WP- 3

    I hope to have a precise answer to my problem.
    SVP.

    Regards

#927889
Brian
Member

Hi,

Sorry for the issues you are having.

Unfortunately, this is custom coding and we are unable to provide support on it.

I can tell you that the date format in the admin does not change it is always yyyy-mm-dd. So your last graphic is correct.

Because of the way that custom code loads the script it may not understand the date format change in our plugin. Not exactly sure what the issue is, but again we cannot troubleshoot custom coding.

Sorry we cannot be of more assistance on customizations.

#936484
Brian
Member

Since I haven’t heard back from you here, I’m going to go ahead and close out this thread. Feel free to start a new thread if you have further issues. Thanks! 🙂

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Change date format’ is closed to new replies.