"serve": "vue-cli-service serve",
vue-cli
.vue.config.js
с содержимым module.exports = {
devServer: {
proxy: 'http://localhost:5000'
}
}
или просто добавить devServer: {
proxy: 'http://localhost:5000'
},
если он уже существует. {
//...
min: 5,
max: 25,
postfix: "%"
}
const today = moment.utc().startOf('day');
const dateFormat = 'YYYY-MM-DD HH:mm:ss';
const mapFunc = ({ End, Start, Amount }) => {
const points = [End, Start];
const shifts = [
moment.utc(today).add(points[0], 's'),
moment.utc(today).add(points[1], 's')
];
for (let i = 2; i <= Amount; i++) {
shifts.push(
moment.utc(shifts[i % 2]).subtract(i / 2 | 0, 'd')
)
}
return shifts.map(d => d.format(dateFormat)).reduce((a, b, i, shifts) => {
a.push(b + ' - ' + shifts[i - 1]);
return a;
}, []).slice(1);
}
console.log(mapFunc({
//"Start": -18000,
//"End": 25200,
"Start": 25200,
"End": 68400,
"Amount": 5
}));
const today = moment().startOf('day');
const dateFormat = 'YYYY-MM-DD HH:mm:ss';
const mapFunc = ({ End, Start, Amount }) => {
const points = [End, Start];
const shifts = [];
const order = Start > End;
const shift = moment(today).subtract( Amount / 2 | 0 + order, 'd' ).seconds(points[1]);
for (let i = 0; i < Amount; i++) {
shifts.push(
shift.format(dateFormat)
+ ' - '
+ shift
.hours(0) // очищаем часы
.minutes(0) // и минуты
.seconds(points[i % 2]) // чередуем временную точку: чёт - End, нечёт - Start
.add(i % 2 ^ order, 'd') // добавляем день если смена переходит на следующий
.format(dateFormat)
)
}
return shifts.reverse()
}
console.log(mapFunc({
"Start": 25200,
"End": 68400,
"Amount": 5
}));