title: How to validate date and time in typeorm and nestjs
body: <p>I'd like to add validation rule in <code>typeorm</code> and <code>nest.js</code> based application.</p>
  <p>my <code>entity</code> and <code>dto</code> is following.</p>
  <p>My desired validation is following</p>
  <pre><code>column     data_type  validation_rule
  
  date         DATE       YYYY:HH:MM
  
  begin_time   TIME       HH:MM
  </code></pre>
  <p>I'd like to know how to add<code>TIME</code> type and how to validate <code>YYY:HH:MM</code></p>
  <p>Are there any way to achive this validation rule in <code>typeorm</code> ?</p>
  <p>My current work is following</p>
  <p>If someone has opinion, please let me know, thanks</p>
  <p><code>event.entity.ts</code></p>
  <pre><code>
    @Entity('events')
    export class Event extends BaseEntity {
      @PrimaryGeneratedColumn('increment', { type: 'int' })
      id: number;
    
      @Column('date')
      date: Date;
  
      @Column('date',{name: 'begin_time'})
      beginTime: Date;
  }
  </code></pre>
  <p><code>event.dto.ts</code></p>
  <pre><code>  export class eventRequest {
      @IsInt()  
      id: number;
        
      @IsDateString()
      date: Date;
  
      @IsDateString()
      beginTime: Date;
  }
  </code></pre>
  <p>Here is details of entire present tables.</p>
  <pre><code>mysql&gt; desc events
      -&gt; ;
  +--------------+--------------+------+-----+----------------------+----------------+
  | Field        | Type         | Null | Key | Default              | Extra          |
  +--------------+--------------+------+-----+----------------------+----------------+
  | id           | int(11)      | NO   | PRI | NULL                 | auto_increment |
  | user_id      | varchar(255) | NO   |     | NULL                 |                |
  | title        | varchar(255) | NO   |     | NULL                 |                |
  | date         | date         | NO   |     | NULL                 |                |
  | is_last_date | varchar(255) | NO   |     | NULL                 |                |
  | begin_time   | date         | NO   |     | NULL                 |                |
  | end_time     | date         | NO   |     | NULL                 |                |
  | place        | varchar(255) | NO   |     | NULL                 |                |
  | label_cd     | int(11)      | NO   |     | NULL                 |                |
  | detail       | varchar(255) | NO   |     | NULL                 |                |
  | createdAt    | datetime(6)  | NO   |     | CURRENT_TIMESTAMP(6) |                |
  | updatedAt    | datetime(6)  | NO   |     | CURRENT_TIMESTAMP(6) |                |
  | deletedAt    | datetime(6)  | YES  |     | NULL                 |                |
  +--------------+--------------+------+-----+----------------------+----------------+
  </code></pre>