Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const ampmTime = () => {
- return Array.from({length: 24}).map((_,i) => {
- if (i === 0){
- return { html: `12am`, value: `0000` };
- }
- if (i < 10){
- return { html: `${i}am`, value: `0${i}00` };
- }
- if (i < 12){
- return { html: `${i}am`, value: `${i}00` };
- }
- if (i === 12){
- return { html: `12pm`, value: `1200` };
- }
- return { html: `${(i - 12)}pm`, value: `${i}00` };
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement