mirror of
https://github.com/danpros/htmly.git
synced 2026-04-18 11:36:20 +05:30
Fix date problems
Fix date problems. Date displayed wrongly.
This commit is contained in:
parent
65a1d44370
commit
29fea933b0
1 changed files with 16 additions and 4 deletions
|
|
@ -121,11 +121,15 @@ function get_posts($posts, $page = 1, $perpage = 0){
|
|||
$post->author = $author;
|
||||
$post->authorurl = site_url() . 'author/' . $author;
|
||||
|
||||
$dt = str_replace($replaced,'',$arr[0]);
|
||||
$time = new DateTime($dt);
|
||||
$timestamp= $time->format("Y-m-d");
|
||||
|
||||
// The post date
|
||||
$post->date = strtotime(str_replace($replaced,'',$arr[0]));
|
||||
$post->date = strtotime($timestamp);
|
||||
|
||||
// The archive per day
|
||||
$post->archive = site_url(). 'archive/' . date('Y-m-d', $post->date) ;
|
||||
$post->archive = site_url(). 'archive/' . $timestamp ;
|
||||
|
||||
// The post URL
|
||||
$post->url = site_url().date('Y/m', $post->date).'/'.str_replace('.md','',$arr[2]);
|
||||
|
|
@ -401,8 +405,12 @@ function get_keyword($keyword){
|
|||
$post->author = $author;
|
||||
$post->authorurl = site_url() . 'author/' . $author;
|
||||
|
||||
$dt = str_replace($replaced,'',$arr[0]);
|
||||
$time = new DateTime($dt);
|
||||
$timestamp= $time->format("Y-m-d");
|
||||
|
||||
// The post date
|
||||
$post->date = strtotime(str_replace($replaced,'',$arr[0]));
|
||||
$post->date = strtotime($timestamp);
|
||||
|
||||
// The post URL
|
||||
$post->url = site_url().date('Y/m', $post->date).'/'.str_replace('.md','',$arr[2]);
|
||||
|
|
@ -901,8 +909,12 @@ function get_path(){
|
|||
|
||||
$post->authorurl = site_url() . 'author/' . $author;
|
||||
|
||||
$dt = str_replace($replaced,'',$arr[0]);
|
||||
$time = new DateTime($dt);
|
||||
$timestamp= $time->format("Y-m-d");
|
||||
|
||||
// The post date
|
||||
$post->date = strtotime(str_replace($replaced,'',$arr[0]));
|
||||
$post->date = strtotime($timestamp);
|
||||
|
||||
// The archive per day
|
||||
$post->archiveday = site_url(). 'archive/' . date('Y-m-d', $post->date) ;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue