Browse Source

description add date

amic 1 year ago
parent
commit
8a24f48a1e
2 changed files with 4 additions and 4 deletions
  1. 1 1
      views/layouts/lenta/countdown.php
  2. 3 3
      views/news/view.php

+ 1 - 1
views/layouts/lenta/countdown.php

@@ -2,7 +2,7 @@
 
 
 $this->registerJs(
 $this->registerJs(
 <<<JS
 <<<JS
-const deadline = new Date(2023, 9, 12);
+const deadline = new Date(2023, 9, 12, 23, 59, 59);
   // id таймера
   // id таймера
   let timerId = null;
   let timerId = null;
   // склонение числительных
   // склонение числительных

+ 3 - 3
views/news/view.php

@@ -43,9 +43,9 @@ if( isset( $model->dt_pub ) && strtotime( $model->dt_pub ) < strtotime('2015-01-
 	$retina = $bad;
 	$retina = $bad;
 };
 };
  */
  */
-
+$txt_date = date( "[Y-m-d] ", strtotime( $model->dt_pub ) );
 Yii::$app->og->title =($model->meta_title)?$model->meta_title:$model->title;
 Yii::$app->og->title =($model->meta_title)?$model->meta_title:$model->title;
-Yii::$app->og->description = ($model->lid && trim($model->lid) <> '')?str_replace( '"', "&quot;", strip_tags($model->lid) ):trim(str_replace( '"',"'",substr(strip_tags( $model->text ),0,150)))."...";
+Yii::$app->og->description = ($model->lid && trim($model->lid) <> '')?str_replace( '"', "&quot;", strip_tags($model->lid) ):$txt_date.trim(str_replace( '"',"'",substr(strip_tags( $model->text ),0,150)))."...";
 
 
 if( $model->active == 'N' || $model->dt_pub > date("Y-m-d H:i:s") || $model->noindex == 'Y' ){
 if( $model->active == 'N' || $model->dt_pub > date("Y-m-d H:i:s") || $model->noindex == 'Y' ){
     Yii::$app->og->noindex = 'Y';
     Yii::$app->og->noindex = 'Y';
@@ -56,7 +56,7 @@ if( $model->active == 'N' || $model->dt_pub > date("Y-m-d H:i:s") || $model->noi
     \Yii::$app->og->og_image = $model->image->url;
     \Yii::$app->og->og_image = $model->image->url;
     \Yii::$app->og->og_type = "article";
     \Yii::$app->og->og_type = "article";
     \Yii::$app->og->og_title = htmlspecialchars(($model->meta_title)?strip_tags(str_replace( '"',"&quot;",$model->meta_title)):strip_tags(str_replace( '"',"&quot;",$model->title)));
     \Yii::$app->og->og_title = htmlspecialchars(($model->meta_title)?strip_tags(str_replace( '"',"&quot;",$model->meta_title)):strip_tags(str_replace( '"',"&quot;",$model->title)));
-    \Yii::$app->og->og_description = ($model->lid && trim($model->lid) <> '')?str_replace( '"',"&quot;",strip_tags($model->lid)):trim(str_replace( '"',"&quot;",substr(strip_tags( $model->text ),0,150)))."...";
+    \Yii::$app->og->og_description = ($model->lid && trim($model->lid) <> '')?str_replace( '"',"&quot;",strip_tags($model->lid)):$txt_date.trim(str_replace( '"',"&quot;",substr(strip_tags( $model->text ),0,150)))."...";
     \Yii::$app->og->dtpub = date( "r", strtotime( $model->dt_pub ) );
     \Yii::$app->og->dtpub = date( "r", strtotime( $model->dt_pub ) );
 }
 }