get month, day (mm-dd) from date (yyyy-mm-dd)

Inputs

  • Date (yyyy-mm-dd)

Outputs

  • month, day (mm-dd)

Neuron type

Best algorithm has been found - locked

Patterns

Pattern Input Output
1.
Date (yyyy-mm-dd): 2018-05-08
month, day (mm-dd): 05-08
2.
Date (yyyy-mm-dd): 2009-11-10
month, day (mm-dd): 11-10
3.
Date (yyyy-mm-dd): 2005-08-09
month, day (mm-dd): 08-09
4.
Date (yyyy-mm-dd): 1930-12-12
month, day (mm-dd): 12-12

Applicable neurons

  • 4
  • 5
  • 6
  • Substring (from position to end)
  • tag h1
  • (a, +∞)
  • Get the last XY characters
  • Contains string any digit?
  • middle
  • Width of persons

Algorithm

Test

Code made by AI:
/**
 * 5: 
 *
 * @return {Array}
 */
function neuron505()
{
return [5];
}

/**
 * Length of string: 
 *
 * @param x1 String
 * @return {Array}
 */
function neuron528(x1)
{
return[x1.toString().length];
}

/**
 * Substring (startPosition, endPosition): Get substring from string - from position - to pos
 *
 * @param x1 MyString
 * @param x2 start position
 * @param x3 end position
 * @return {Array}
 */
function neuron525(x1, x2, x3)
{
return[x1.toString().substring(x2, x3)];
}

/**
 * Substring (from position to end): 
 * 
 * @param x1 MyString
 * @param x2 start position
 * @return {Array}
 */
function neuron529(x1, x2)
{
  var outputs = [];
  outputs[0] = x1;
  outputs[1] = x2;

  arr = neuron528(outputs[0]);
  outputs[2] = arr[0];

  arr = neuron525(outputs[0], outputs[1], outputs[2]);
  outputs[3] = arr[0];

  return[outputs[3]];
}


/**
 * get month, day (mm-dd) from  date (yyyy-mm-dd): 
 * 
 * @param x1 Date (yyyy-mm-dd)
 * @return {Array}
 */
function neuron905(x1)
{
  var outputs = [];
  outputs[0] = x1;

  arr = neuron505();
  outputs[1] = arr[0];

  arr = neuron529(outputs[0], outputs[1]);
  outputs[2] = arr[0];

  return[outputs[2]];
}


Code made by AI:

Create your family tree for free