comparison client/src/components/map/contextbox/Bottlenecks.vue @ 1521:276df8dadc14

bought localized datestrings
author Thomas Junk <thomas.junk@intevation.de>
date Thu, 06 Dec 2018 16:35:53 +0100
parents 6ad1f431bc85
children
comparison
equal deleted inserted replaced
1520:6ad1f431bc85 1521:276df8dadc14
52 <a href="#" @click="selectBottleneck(bottleneck)">{{ 52 <a href="#" @click="selectBottleneck(bottleneck)">{{
53 bottleneck.properties.name 53 bottleneck.properties.name
54 }}</a> 54 }}</a>
55 </div> 55 </div>
56 <div class="col-2 py-2"> 56 <div class="col-2 py-2">
57 {{ displayCurrentSurvey(bottleneck.properties.current) }} 57 {{ formatSurveyDate(bottleneck.properties.current) }}
58 </div> 58 </div>
59 <div class="col-3 py-2"> 59 <div class="col-3 py-2">
60 {{ 60 {{
61 displayCurrentChainage( 61 displayCurrentChainage(
62 bottleneck.properties.from, 62 bottleneck.properties.from,
106 href="#" 106 href="#"
107 class="d-block px-3 py-2" 107 class="d-block px-3 py-2"
108 v-for="(survey, index) in openBottleneckSurveys" 108 v-for="(survey, index) in openBottleneckSurveys"
109 :key="index" 109 :key="index"
110 @click="selectSurvey(survey, bottleneck)" 110 @click="selectSurvey(survey, bottleneck)"
111 >{{ survey.date_info }}</a 111 >{{ formatSurveyDate(survey.date_info) }}</a
112 > 112 >
113 </div> 113 </div>
114 </div> 114 </div>
115 </div> 115 </div>
116 <div v-else class="small text-center py-3 border-top"> 116 <div v-else class="small text-center py-3 border-top">
134 * Markus Kottländer <markus.kottlaender@intevation.de> 134 * Markus Kottländer <markus.kottlaender@intevation.de>
135 */ 135 */
136 import { mapState } from "vuex"; 136 import { mapState } from "vuex";
137 import { HTTP } from "../../../lib/http"; 137 import { HTTP } from "../../../lib/http";
138 import { displayError } from "../../../lib/errors.js"; 138 import { displayError } from "../../../lib/errors.js";
139 import { formatSurveyDate } from "../../../lib/date.js";
139 140
140 export default { 141 export default {
141 name: "bottlenecks", 142 name: "bottlenecks",
142 data() { 143 data() {
143 return { 144 return {
160 ? "sort-amount-down" 161 ? "sort-amount-down"
161 : "sort-amount-up"; 162 : "sort-amount-up";
162 } 163 }
163 }, 164 },
164 methods: { 165 methods: {
166 formatSurveyDate(date) {
167 return formatSurveyDate(date);
168 },
165 filteredAndSortedBottlenecks() { 169 filteredAndSortedBottlenecks() {
166 return this.bottlenecks 170 return this.bottlenecks
167 .filter(bn => { 171 .filter(bn => {
168 return bn.properties.name 172 return bn.properties.name
169 .toLowerCase() 173 .toLowerCase()
273 }); 277 });
274 }) 278 })
275 .finally(() => (this.loading = null)); 279 .finally(() => (this.loading = null));
276 } 280 }
277 }, 281 },
278 displayCurrentSurvey(current) {
279 return current ? current : "";
280 },
281 displayCurrentChainage(from, to) { 282 displayCurrentChainage(from, to) {
282 return from / 10 + " - " + to / 10; 283 return from / 10 + " - " + to / 10;
283 } 284 }
284 }, 285 },
285 mounted() { 286 mounted() {