Skip to content

Commit

Permalink
Format time and add creatime
Browse files Browse the repository at this point in the history
  • Loading branch information
Max-Sum committed Mar 29, 2018
1 parent f103833 commit 9934e59
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lib/onedrive.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ static function dir($path="/"){
$return[$item['name']] = array(
'name'=>$item['name'],
'size'=>self::human_filesize($item['size']),
'lastModifiedDateTime'=>$item['lastModifiedDateTime'],
'createdDateTime'=>strtotime($item['createdDateTime']),
'lastModifiedDateTime'=>strtotime($item['lastModifiedDateTime']),
'downloadUrl'=>$item['@content.downloadUrl'],
'folder'=>empty($item['folder'])?false:true
);
Expand Down
9 changes: 6 additions & 3 deletions view/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
<body>
<h1 id="heading">Index of <?php echo urldecode($path);?></h1>
<table id="table">
<tr><th class="file-name">Name</th><th class="file-size">Size</th><th class="file-date-modified">Date Modified</th></tr>
<tr><th class="file-name">Name</th><th class="file-size">Size</th><th class="file-date-created">Date Created</th><th class="file-date-modified">Date Modified</th></tr>
<?php if($path != '/'):?>
<tr>
<td class="file-name">
<a class="icon icon-up" href="<?php echo get_absolute_path($root_path.$path.'../');?>">..</a>
</td>
<td class="file-size"></td>
<td class="file-date-created"></td>
<td class="file-date-modified"></td>
</tr>
<?php endif;?>
Expand All @@ -27,13 +28,15 @@
<tr>
<td class="file-name"><a class="icon icon-dir" href="<?php echo get_absolute_path($root_path.$path.$item['name']);?>"><?php echo $item['name'];?>/</a></td>
<td class="file-size"><?php echo $item['size'];?></td>
<td class="file-date-modified"><?php echo $item['lastModifiedDateTime'];?></td>
<td class="file-date-created"><?php echo date("Y-m-d H:i:s", $item['createdDateTime']);?></td>
<td class="file-date-modified"><?php echo date("Y-m-d H:i:s", $item['lastModifiedDateTime']);?></td>
</tr>
<?php else:?>
<tr>
<td class="file-name"><a class="icon icon-file" href="<?php echo get_absolute_path($root_path.$path).$item['name'];?>"><?php echo $item['name'];?></a></td>
<td class="file-size"><?php echo $item['size'];?></td>
<td class="file-date-modified">&nbsp;<?php echo $item['lastModifiedDateTime'];?></td>
<td class="file-date-created">&nbsp;<?php echo date("Y-m-d H:i:s", $item['createdDateTime']);?></td>
<td class="file-date-modified">&nbsp;<?php echo date("Y-m-d H:i:s", $item['lastModifiedDateTime']);?></td>
</tr>
<?php endif;?>
<?php endforeach;?>
Expand Down

0 comments on commit 9934e59

Please sign in to comment.