title: How i can insert am pm for the time based on my code or if you have how to make custom time
body: <p>I have a method that forms a time based on the minute and hour. so what I want in here is to add am pm</p>
  
  <pre><code>customTime(time_type, formula) {
      this.isCustomTime = true;
      let hour;
      let minute;
      if(time_type == 'hour' &amp;&amp; formula == 'add'){    
          hour = Number(this.defaultHour) + 1;
          if(hour &gt; 12) {
              hour = 1;
          }
          this.defaultHour = ('0' + hour).slice(-2);
      }else if(time_type == 'hour' &amp;&amp; formula == 'minus'){    
          hour = Number(this.defaultHour) - 1;
          if(hour &lt; 1){
              hour = 12;
          }
          this.defaultHour = ('0' + hour).slice(-2);
      }else if(time_type == 'minute' &amp;&amp; formula == 'add'){
          minute = Number(this.defaultMinute);
          hour = Number(this.defaultHour);
          if(minute &lt; 30) {
              minute = 30;
          }else{
              minute += 30;
              if(minute &gt; 59) {
                  minute = 0;
                  hour += 1;
                  if(hour &gt; 12) {
                      hour = 1;
                  }
                  this.defaultHour = ('0' + hour).slice(-2);
              }
          }
          this.defaultMinute = ('0' + minute).slice(-2);
      }else if(time_type == 'minute' &amp;&amp; formula == 'minus'){ 
          minute = Number(this.defaultMinute);
          hour = Number(this.defaultHour);
          if(minute &gt; 30 || minute == 0) {        
              minute = 30;
              hour -= 1;
              if(hour &lt; 1){
                  hour = 12;
              }
              this.defaultHour = ('0' + hour).slice(-2);
          }else {     
              minute = 0;
          }
          this.defaultMinute = ('0' + minute).slice(-2);
      }
  }
  </code></pre>
  
  <p>Note: It is working. Only the <code>AM/PM</code> of the time missing in here. So can I add those to my code or if you have some easy on how to make what I want? </p>