Beispiel #1
0
 function getItemDate()
 {
     $date_item = $this->getData('dcdate');
     if (!AMP_verifyDateValue($date_item)) {
         return AMP_NULL_DATE_VALUE_DB;
     }
     return $date_item;
 }
Beispiel #2
0
 function render_date(&$source)
 {
     $date = $source->getItemDate();
     if (!AMP_verifyDateValue($date)) {
         return false;
     }
     return $this->_renderer->span(AMP_TEXT_PR_HEADING . DoDate($date, AMP_CONTENT_DATE_FORMAT), array('class' => $this->_css_class_date)) . $this->_renderer->newline();
 }
Beispiel #3
0
 function render_date($source)
 {
     $date = $source->getItemDate();
     if (!AMP_verifyDateValue($date)) {
         return false;
     }
     return date(AMP_CONTENT_DATE_FORMAT, strtotime($date));
 }
Beispiel #4
0
 function format_date($value)
 {
     if (!AMP_verifyDateValue($value)) {
         return false;
     }
     $date_value = strtotime($value);
     return date('M j, Y', $date_value);
 }
Beispiel #5
0
 function getSectionDate()
 {
     if (!($value = $this->getData('date2'))) {
         return false;
     }
     if (!AMP_verifyDateValue($value)) {
         return false;
     }
     return $value;
 }
Beispiel #6
0
 function acceptingNewComments()
 {
     if (!$this->allowsComments()) {
         return false;
     }
     if (!($comments_expiration = AMP_verifyDateValue($this->getData('comments_allowed_until')))) {
         return true;
     }
     return $comments_expiration > date("Y-m-d", time());
 }
Beispiel #7
0
 function getEndDate()
 {
     $end_date = $this->getData('dateended');
     return AMP_verifyDateValue($end_date);
 }
Beispiel #8
0
 function _makeDbDateTime($data, $fieldname)
 {
     if (!isset($data[$fieldname])) {
         return false;
     }
     if (!is_array($data[$fieldname])) {
         return false;
     }
     $value = $data[$fieldname];
     $month = isset($value['M']) && $value['M'] ? $value['M'] : (isset($value['m']) && $value['m'] ? $value['m'] : 0);
     $day = isset($value['D']) && $value['D'] ? $value['D'] : (isset($value['d']) && $value['d'] ? $value['d'] : false);
     $year = isset($value['Y']) && $value['Y'] ? $value['Y'] : (isset($value['y']) && $value['y'] ? $value['y'] : 0);
     $hour = isset($value['H']) && $value['H'] ? $value['H'] : 0;
     $hour = isset($value['h']) && $value['h'] ? $value['h'] : $hour;
     $minute = isset($value['i']) && $value['i'] ? $value['i'] : 0;
     $second = isset($value['s']) && $value['s'] ? $value['s'] : 0;
     if (isset($value['a']) && $value['a'] == 'pm') {
         $hour += 12;
     }
     $time_stamped = mktime($hour, $minute, $second, $month, $day, $year);
     if (!$time_stamped) {
         return false;
     }
     $dat_is_good = date('Y-m-d H:i:s', $time_stamped);
     if (!AMP_verifyDateTimeValue(date('Y-m-d H:i:s', $time_stamped))) {
         return AMP_NULL_DATETIME_VALUE_DB;
     }
     if (!AMP_verifyDateValue(date('Y-m-d', $time_stamped))) {
         return AMP_NULL_DATETIME_VALUE_DB;
     }
     return date('YmdHis', $time_stamped);
 }
Beispiel #9
0
 function _makeNullDate($data, $fieldname)
 {
     if (!isset($data[$fieldname])) {
         return '';
     }
     if (AMP_verifyDateValue($data[$fieldname])) {
         return $data[$fieldname];
     }
     return '';
 }
Beispiel #10
0
 function update_expiration_date()
 {
     $current_expiration = $this->get_expiration_date();
     $current_start = $this->get_start_date();
     trigger_error('old expire date ' . $current_expiration);
     //default membership start date is the 1st payment date
     if (!AMP_verifyDateValue($current_expiration)) {
         $current_expiration = $current_start;
         trigger_error('start date ' . $current_expiration);
     }
     if ($current_expiration < $current_start) {
         $current_expiration = $current_start;
     }
     $new_expiration_date = date('Y-m-d', strtotime("+1 year", strtotime($current_expiration)));
     trigger_error('new expiration date ' . $new_expiration_date);
     $this->data->mergeData(array(WIN_MEMBERSHIP_EXPIRATION => $new_expiration_date));
     $this->data->save();
 }