We propose an L1-type scheme on nonuniform meshes to approximate the Caputo-Hadamard derivative. While this scheme shares a similar structure with the logarithmic L1 formula, it differs in the selection of mesh points, making it more applicable. Next, we consider the numerical solution of a class of variable-coefficient diffusion equation involving the time Caputo-Hadamard derivative. To provide a theoretical foundation for the design of the numerical scheme, we first study the regularity of the solution to this equation. Then, we discretize the time-fractional derivative using the derived L1 scheme and approximate the spatial derivative by the local discontinuous Galerkin (LDG) finite element method, resulting in a fully discrete scheme. We prove the stability and convergence of this scheme and validate its performance through numerical experiments.