Showing
3 changed files
with
14 additions
and
3 deletions
| ... | @@ -4,6 +4,7 @@ use Activity; | ... | @@ -4,6 +4,7 @@ use Activity; |
| 4 | use BookStack\Exceptions\NotFoundException; | 4 | use BookStack\Exceptions\NotFoundException; |
| 5 | use BookStack\Repos\UserRepo; | 5 | use BookStack\Repos\UserRepo; |
| 6 | use BookStack\Services\ExportService; | 6 | use BookStack\Services\ExportService; |
| 7 | +use Carbon\Carbon; | ||
| 7 | use Illuminate\Http\Request; | 8 | use Illuminate\Http\Request; |
| 8 | use BookStack\Http\Requests; | 9 | use BookStack\Http\Requests; |
| 9 | use BookStack\Repos\BookRepo; | 10 | use BookStack\Repos\BookRepo; |
| ... | @@ -214,8 +215,14 @@ class PageController extends Controller | ... | @@ -214,8 +215,14 @@ class PageController extends Controller |
| 214 | } else { | 215 | } else { |
| 215 | $draft = $this->pageRepo->saveUpdateDraft($page, $request->only(['name', 'html', 'markdown'])); | 216 | $draft = $this->pageRepo->saveUpdateDraft($page, $request->only(['name', 'html', 'markdown'])); |
| 216 | } | 217 | } |
| 217 | - $updateTime = $draft->updated_at->format('H:i'); | 218 | + |
| 218 | - return response()->json(['status' => 'success', 'message' => 'Draft saved at ' . $updateTime]); | 219 | + $updateTime = $draft->updated_at->timestamp; |
| 220 | + $utcUpdateTimestamp = $updateTime + Carbon::createFromTimestamp(0)->offset; | ||
| 221 | + return response()->json([ | ||
| 222 | + 'status' => 'success', | ||
| 223 | + 'message' => 'Draft saved at ', | ||
| 224 | + 'timestamp' => $utcUpdateTimestamp | ||
| 225 | + ]); | ||
| 219 | } | 226 | } |
| 220 | 227 | ||
| 221 | /** | 228 | /** | ... | ... |
| ... | @@ -13,6 +13,7 @@ | ... | @@ -13,6 +13,7 @@ |
| 13 | "dropzone": "^4.0.1", | 13 | "dropzone": "^4.0.1", |
| 14 | "laravel-elixir": "^3.4.0", | 14 | "laravel-elixir": "^3.4.0", |
| 15 | "marked": "^0.3.5", | 15 | "marked": "^0.3.5", |
| 16 | + "moment": "^2.12.0", | ||
| 16 | "zeroclipboard": "^2.2.0" | 17 | "zeroclipboard": "^2.2.0" |
| 17 | } | 18 | } |
| 18 | } | 19 | } | ... | ... |
| 1 | "use strict"; | 1 | "use strict"; |
| 2 | 2 | ||
| 3 | +var moment = require('moment'); | ||
| 4 | + | ||
| 3 | module.exports = function (ngApp, events) { | 5 | module.exports = function (ngApp, events) { |
| 4 | 6 | ||
| 5 | ngApp.controller('ImageManagerController', ['$scope', '$attrs', '$http', '$timeout', 'imageManagerService', | 7 | ngApp.controller('ImageManagerController', ['$scope', '$attrs', '$http', '$timeout', 'imageManagerService', |
| ... | @@ -367,7 +369,8 @@ module.exports = function (ngApp, events) { | ... | @@ -367,7 +369,8 @@ module.exports = function (ngApp, events) { |
| 367 | if (isMarkdown) data.markdown = $scope.editContent; | 369 | if (isMarkdown) data.markdown = $scope.editContent; |
| 368 | 370 | ||
| 369 | $http.put('/ajax/page/' + pageId + '/save-draft', data).then((responseData) => { | 371 | $http.put('/ajax/page/' + pageId + '/save-draft', data).then((responseData) => { |
| 370 | - $scope.draftText = responseData.data.message; | 372 | + var updateTime = moment.utc(moment.unix(responseData.data.timestamp)).toDate(); |
| 373 | + $scope.draftText = responseData.data.message + moment(updateTime).format('H:m'); | ||
| 371 | if (!$scope.isNewPageDraft) $scope.isUpdateDraft = true; | 374 | if (!$scope.isNewPageDraft) $scope.isUpdateDraft = true; |
| 372 | }); | 375 | }); |
| 373 | } | 376 | } | ... | ... |
-
Please register or sign in to post a comment