Skip to content
Snippets Groups Projects
Commit 1c8c899c authored by Håkon Eilertsen Røskaft's avatar Håkon Eilertsen Røskaft
Browse files

Merge branch 'main' of...

Merge branch 'main' of https://gitlab.stud.idi.ntnu.no/idatt2106_2022_02/boco-frontend into rental-image-chat
parents b9073216 3207eed3
No related branches found
No related tags found
1 merge request!143Rental image chat
...@@ -58,12 +58,18 @@ export default { ...@@ -58,12 +58,18 @@ export default {
calculateTime() { calculateTime() {
var time = this?.message.timestamp; var time = this?.message.timestamp;
var date = new Date(time); var date = new Date(time);
//Todo add timing for mm and hh and week of message
var mmOfMessage = String(date.getMinutes()); var mmOfMessage = String(date.getMinutes());
var hhOfMessage = String(date.getHours()); var hhOfMessage = String(date.getHours());
if(mmOfMessage <= 9){
mmOfMessage = "0" + mmOfMessage;
}
if(hhOfMessage<=9){
hhOfMessage = "0" + hhOfMessage;
}
var ddOfMessage = String(date.getDate()).padStart(2, "0"); var ddOfMessage = String(date.getDate()).padStart(2, "0");
var dayOfMessage = date.toLocaleString("default", { weekday: "short" }); var dayOfMessage = date.toLocaleString("default", { weekday: "short" });
var monthOfMessage = String(date.getMonth() + 1).padStart(2, "0"); //January is 0! var monthOfMessage = String(date.getMonth() + 1).padStart(2, "0");
const shortMonthOfMessage = date.toLocaleString("default", { const shortMonthOfMessage = date.toLocaleString("default", {
month: "short", month: "short",
}); });
...@@ -71,7 +77,7 @@ export default { ...@@ -71,7 +77,7 @@ export default {
var today = new Date(); var today = new Date();
var dd = String(today.getDate()).padStart(2, "0"); var dd = String(today.getDate()).padStart(2, "0");
var mm = String(today.getMonth() + 1).padStart(2, "0"); //January is 0! var mm = String(today.getMonth() + 1).padStart(2, "0");
var yyyy = today.getFullYear(); var yyyy = today.getFullYear();
if (ddOfMessage == dd) { if (ddOfMessage == dd) {
return "" + hhOfMessage + ":" + mmOfMessage + ""; return "" + hhOfMessage + ":" + mmOfMessage + "";
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</template> </template>
<script> <script>
// import CommunityAdminService from "@/services/community-admin.service"; import CommunityAdminService from "@/services/community-admin.service";
import IconButton from "@/components/BaseComponents/IconButton.vue"; import IconButton from "@/components/BaseComponents/IconButton.vue";
//TODO: OPEN CONFIRMATION DIALOG WHEN DELETING //TODO: OPEN CONFIRMATION DIALOG WHEN DELETING
...@@ -19,9 +19,12 @@ export default { ...@@ -19,9 +19,12 @@ export default {
IconButton, IconButton,
}, },
methods: { methods: {
deleteCommunity() { async deleteCommunity() {
console.log("DELETED"); let response = await CommunityAdminService.deleteCommunity(
// CommunityAdminService.deleteCommunity(this.$route.params.communityID); this.$route.params.communityID
);
if (response.status === 200)
this.$router.push({ name: "home", replace: true });
}, },
}, },
}; };
......
...@@ -97,7 +97,10 @@ export default { ...@@ -97,7 +97,10 @@ export default {
getDateString(milliseconds) { getDateString(milliseconds) {
let today = new Date(); let today = new Date();
let date = new Date(milliseconds); let date = new Date(milliseconds);
let dateString = date.getDate() + "." + (date.getMonth() + 1); const shortMonthOfRentHistoryItem = date.toLocaleString("default", {
month: "short",
});
let dateString = date.getDate() + ". " + shortMonthOfRentHistoryItem;
if (date.getFullYear() != today.getFullYear()) { if (date.getFullYear() != today.getFullYear()) {
dateString += "." + date.getFullYear(); dateString += "." + date.getFullYear();
......
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
<rating-component :rating="ownerRating" :ratingType="'Utleier'" /> <rating-component :rating="ownerRating" :ratingType="'Utleier'" />
</div> </div>
<div v-show="!isCurrentUser" class="flex mt-4 space-x-3 lg:mt-6"> <div v-show="!isCurrentUser" @click="$router.push('/messages?userID=' + id)" class="flex mt-4 space-x-3 lg:mt-6">
<a <a
href="#" href="#"
class="inline-flex items-center py-2 px-4 text-sm font-medium text-center text-gray-900 bg-white rounded-lg border border-gray-300 hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-700 dark:focus:ring-gray-700" class="inline-flex items-center py-2 px-4 text-sm font-medium text-center text-gray-900 bg-white rounded-lg border border-gray-300 hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-700 dark:focus:ring-gray-700"
......
...@@ -60,7 +60,7 @@ class CommunityAdminService { ...@@ -60,7 +60,7 @@ class CommunityAdminService {
* @returns TODO * @returns TODO
*/ */
async deleteCommunity(communityID) { async deleteCommunity(communityID) {
return await axios.post( return await axios.delete(
API_URL + "communities/" + communityID + "/remove", API_URL + "communities/" + communityID + "/remove",
{ {
headers: tokenHeader(), headers: tokenHeader(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment