Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

106
Views
How to create Google calendar link date in Javascript 2022?

In 2022 the create Google calendar event link looks like this:

https://calendar.google.com/calendar/u/0/r/eventedit?sf=true&output=xml&text=sometext&location=somelocation&details=somedetails&dates=20220418T013000Z/20220416T020000Z

How do you formate such date in Javascript?

const formatDate = (date) => {
 ???
};
const myDate = new Date();
const myFormattedDate = formatDate(myDate);
console.log(myFormattedDate)

expecting output:

20220418T013000Z

Any nice looking and easy solution (rather than getHours(),getMinutes(),etc.)?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

JS Dates have an inbuilt .toISOString() method which gets the right format, then just remove special characters:

  let date = new Date();
  let isoDate = date.toISOString()
  let formattedDate = isoDate.replace(/[^\w\s]/gi, '');

  console.log(formattedDate)
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!