Reputation: 593
Currently I am working with ionic 3 with angular 4 project,In which I need to subtract 10 minutes from Time, which is picked from time picker in HH:MM format.
example :
I have variable `X = 06:30` ; Now i have to subtract `10` minutes from `X`.
How it will get deal ?
Upvotes: 1
Views: 1170
Reputation: 3051
Install moment guide
npm i moment --save
Import it
import * as moment from 'moment';
Use this this line of code
const res = moment("06:30","hh:mm").subtract(10, 'minutes');
Have a look at the example I created
Upvotes: 2