title: is there any way to store 'date' value to the Realtime firebase database?
body: <p><strong>JavaScript</strong></p>
  <ol>
  <li><p>This is my JavaScript code  I want to store Date value to
  firebase but some reason it is storing only 4 values from the form
  whereas I wanted to store 6</p>
  </li>
  <li><p>did I choose a wrong backend language for the database ?</p>
  </li>
  <li><p>This is my JavaScript code  I want to store Date value to
  firebase but some reason it is storing only 4 values from the form
  whereas I wanted to store 6</p>
  </li>
  <li><p>did I choose a wrong backend language for the database ?</p>
  </li>
  <li><p>This is my JavaScript code  I want to store Date value to
  firebase but some reason it is storing only 4 values from the form
  whereas I wanted to store 6</p>
  </li>
  <li><p>did I choose a wrong backend language for the database ?</p>
  </li>
  <li><p>This is my JavaScript code  I want to store Date value to
  firebase but some reason it is storing only 4 values from the form
  whereas I wanted to store 6</p>
  </li>
  <li><p>did I choose a wrong backend language for the database ?</p>
  <pre><code>var firebaseConfig = {
    apiKey: &quot;AIzaSyBM93QmsJlOUL8dfyiQdAIUxIyQvIdbuW4&quot;,
    authDomain: &quot;form-a8c0e.firebaseapp.com&quot;,
    projectId: &quot;form-a8c0e&quot;,
    storageBucket: &quot;form-a8c0e.appspot.com&quot;,
    messagingSenderId: &quot;839286832311&quot;,
    appId: &quot;1:839286832311:web:3afbc112b987a15f22a132&quot;,
  };
  // Initialize Firebase
  firebase.initializeApp(firebaseConfig);
  
  // Reference messages collection
  var messagesRef = firebase.database().ref(&quot;messages&quot;);
  
  // Listen for form submit
  document.getElementById(&quot;contactForm&quot;).addEventListener(&quot;submit&quot;, submitForm);
  
  // Submit form
  function submitForm(e) {
    e.preventDefault();
  
    // Get values
    var name = getInputVal(&quot;name&quot;);
    var email = getInputVal(&quot;email&quot;);
    var phone = getInputVal(&quot;phone&quot;);
    var message = getInputVal(&quot;message&quot;);
    var message = getInputVal(&quot;haircut&quot;);
    var message = getInputVal(&quot;haircutTypes&quot;);
  
    // Save message
    saveMessage(name, email, phone, message, haircut, haircutTypes);
  
    // Show alert
    document.querySelector(&quot;.alert&quot;).style.display = &quot;block&quot;;
  
    // Hide alert after 3 seconds
    setTimeout(function () {
      document.querySelector(&quot;.alert&quot;).style.display = &quot;none&quot;;
    }, 2500);
  
    // Clear form
    document.getElementById(&quot;contactForm&quot;).reset();
  }
  
  // Function to get get form values
  function getInputVal(id) {
    return document.getElementById(id).value;
  }
  
  // Save message to firebase
  function saveMessage(name, email, phone, message, haircut, haircutTypes) {
    var newMessageRef = messagesRef.push();
    newMessageRef.set({
      name: name,
      email: email,
      phone: phone,
      message: message,
      haircut: haircut,
      haircutTypes: haircutTypes,
    });
  }  
  </code></pre>
  </li>
  </ol>
  <p>what it is doing is storing data of haircuttype to message</p>