File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 306
306
</div >
307
307
<!-- Post Body -->
308
308
<!-- TODO(akinsey): post-processing="post.body_html" style-fix="true" -->
309
- <div class =" post-body" :dir =" textDirection(postData.data.board?.right_to_left)" :class =" { 'rtl': postData.data.board?.right_to_left }" v-html =" post.body_html" ></div >
309
+ <div class =" post-body" :dir =" textDirection(postData.data.board?.right_to_left)" :class =" { 'rtl': postData.data.board?.right_to_left }" v-html =" formatDateStrings( post.body_html) " ></div >
310
310
<div v-if =" post.user.signature && !disableSignature" >
311
311
<!-- TODO(akinsey): post-processing="post.user.signature" style-fix="true" -->
312
312
<div class =" post-signature" v-html =" post.user.signature" ></div >
@@ -990,6 +990,18 @@ export default {
990
990
})
991
991
}
992
992
993
+ const formatDateStrings = (body_html ) => {
994
+ const regex = / \b unix_timestamp=\d {10} \b /
995
+ let searchIndex = body_html .search (regex)
996
+ while (searchIndex >= 0 ) { // while loop to handle nested quote timestamps
997
+ const dateUnix = body_html .match (regex)
998
+ const date = humanDate (dateUnix[0 ].slice (15 ) * 1000 )
999
+ body_html = body_html .replace (regex, date)
1000
+ searchIndex = body_html .search (regex)
1001
+ }
1002
+ return body_html
1003
+ }
1004
+
993
1005
const createPost = post => postsApi .create (post)
994
1006
.then (p => {
995
1007
const limit = localStoragePrefs ().data .posts_per_page
@@ -1118,7 +1130,8 @@ export default {
1118
1130
watchThread,
1119
1131
toggleIgnoredPosts,
1120
1132
openMoveThreadModal,
1121
- checkUsersOnline
1133
+ checkUsersOnline,
1134
+ formatDateStrings
1122
1135
}
1123
1136
}
1124
1137
}
You can’t perform that action at this time.
0 commit comments