function dom_class_set_date_with_format($dom, $classname, $date)
 {
     $finder = new DomXPath($dom);
     $nodes = $finder->query("//*[contains(concat(' ', normalize-space(@class), ' '), ' {$classname} ')]");
     if ($nodes->length > 0) {
         foreach ($nodes as $node) {
             /*
             $node->setAttribute('data-date', date('Y-m-d\TH:i:s',$date) );
             $node->setAttribute('data-format', $node->nodeValue );
             */
             $format = $node->nodeValue;
             $node->nodeValue = '';
             $value = fc_date_format($date, $format, $this->get_date_options());
             if (!empty($value)) {
                 $f = $dom->createDocumentFragment();
                 $value = $this->sanitize_dom_fragment_value($value);
                 $f->appendXML($value);
                 $node->appendChild($f);
             }
         }
     }
 }
function fc_get_repeat_end_date($post_id, $fc_date_format = false)
{
    if (false === $fc_date_format) {
        global $rhc_plugin;
        $fc_date_format = $rhc_plugin->get_option('cal_eventlistdateformat', 'dddd MMMM d, yyyy', true);
    }
    $date = get_repeat_end_date($post_id, false);
    return fc_date_format($date, $fc_date_format);
    /*
    return sprintf("<script type=\"text/javascript\">try{document.write(jQuery.fullCalendar.formatDate( jQuery.fullCalendar.parseDate('%s'), '%s', %s ))}catch(e){}</script>",
    	$date,
    	$fc_date_format,
    	fc_get_date_options()
    );
    */
}