Version: 6.2.*
Requisites
- Docker
- Docker-compose
| const arr = [ | |
| {id: 1, title: 'hello', parent_id: 0}, | |
| {id: 2, title: 'hello', parent_id: 0}, | |
| {id: 3, title: 'hello', parent_id: 1}, | |
| {id: 4, title: 'hello', parent_id: 3}, | |
| {id: 5, title: 'hello', parent_id: 4}, | |
| {id: 6, title: 'hello', parent_id: 4}, | |
| {id: 7, title: 'hello', parent_id: 3}, | |
| {id: 8, title: 'hello', parent_id: 2} | |
| ]; |
| let number = '1234568,65'; | |
| number = number.replace(/,/g, '.'); | |
| const parsedNumber = numeral(number); | |
| console.log(number); | |
| console.log('Format', parsedNumber.format('0,0.00')) | |
| console.log('Value', parsedNumber.value()) |
| import { ExpenseBudget } from "../models"; | |
| import expenseBudget = require("../schemas/expenseBudget"); | |
| const filter = require('lodash/filter'); | |
| const data = [ | |
| { | |
| "index": 1, | |
| "year": 2019, | |
| "month": 1, |
| <?php | |
| use App\Models\TaskCatalog; | |
| use Carbon\Carbon; | |
| use Illuminate\Database\Migrations\Migration; | |
| use Illuminate\Support\Facades\DB; | |
| use Illuminate\Support\Str; | |
| class AddTaskCatalogs extends Migration | |
| { |
| [ | |
| { | |
| "transaction": { | |
| "user_id": 6, | |
| "month": 5, | |
| "year": 2020, | |
| "updated_at": "2020-06-18T22:32:58.000000Z", | |
| "created_at": "2020-06-18T22:32:58.000000Z", | |
| "id": 1 | |
| }, |
| currentMonths.map(currentMonth => { | |
| const transaction = results.transactions.find(transaction => { | |
| return `${transaction.year}-${transaction.month}` === `${currentMonth.year}-${currentMonth.month}` | |
| }); | |
| console.log(transaction.details) // Aqui estan los detalles de ese mes | |
| }) | |
| { | |
| "transactions": [ | |
| { | |
| "id": 2, | |
| "month": "2", | |
| "year": "2020", | |
| "user_id": "6", | |
| "transaction_date": "2020-07-07 03:24:43", | |
| "created_at": "2020-07-07T03:24:43.000000Z", | |
| "updated_at": "2020-07-07T03:24:43.000000Z", |
| ['1-2020', '2-2020', '3-2020'].map(shortDate => { | |
| const transaction = transactions.find(transaction => `${transaction.month}-${transaction.year}` === shortDate); | |
| const {total_incomes, total_expenses, utility_before_taxes} = transaction.details; | |
| return {date: shortDate, total_incomes, total_expenses, utility_before_taxes}; | |
| }); | |
| // [ | |
| // {date: '1-2020', total_incomes: 0, total_expenses: 0, utility_before_taxes: 0}, | |
| // {date: '2-2020', total_incomes: 0, total_expenses: 0, utility_before_taxes: 0}, | |
| // {date: '3-2020', total_incomes: 0, total_expenses: 0, utility_before_taxes: 0} |