I was thinking about how I would go about calculating the time taken for a swing to swing from one side to the other, assuming that there only exists a gravitational force and discarding all other forms of resistance/friction.

The best way to demonstrate this scenario is with this image:

enter image description here

The black line is the movement of the swing. For now I'm only interested in knowing how long it takes from $(-x, h)$ to the middle $(0, 0)$. This is my attempt to solve this problem.

I know that $\frac{1}{2}mv^{2} = mgh_\text{max} - mgh$, solving for $v$ gives $$v = \sqrt{2g(h_\text{max} - h)}.$$

Since, $$\omega = \frac{v}{r} = \frac{\sqrt{2g(h_\text{max} - h)}}{r},$$ in order to make this practical, for the sake of simplicity lets plug in a few numbers. Let the highest point be $2m$, therefore the radius is also $2m$ and the gravitational acceleration is $9.8\,\text{m/s}^2$ this reduces the equation to $$ w(h) = \frac{\sqrt{19.6(2 - h)}}{2}. $$ The maximum angular velocity is when $h=0$, $w(0) \approx 3.13\,\text{rad/s}$.

I also thought about this in another way: $$w(\theta) = \omega_\text{max}\sin(\theta) = 3.13\sin(\theta)$$

Angular velocity is $\omega = \mathrm{d} \theta/\mathrm{d} t$, this is where I'm stuck. I've attempted to solve many differential equations but they don't have a solution. I've also tried to think about $\sin(\theta)$ as $\sin(kt)$ or $\sin(kh)$ where $k$ is just some constant, but nothing seems to work.

Probably the easiest one that comes to mind is $$ \int_{\pi}^{\frac{3}{2}\pi}\frac{1}{3.13\sin(\theta)}\,\mathrm d\theta = \int_{0}^{t}\,\mathrm dt, $$ this however is undefined.

What have I done wrong? How could I solve for the time taken?