All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.guerlab.spring.commons.converter.LocalDateConverter Maven / Gradle / Ivy

package net.guerlab.spring.commons.converter;

import java.time.LocalDate;
import java.time.LocalDateTime;

import org.springframework.core.convert.converter.Converter;

import net.guerlab.commons.time.TimeHelper;

/**
 * 日期转换
 *
 * @author guer
 *
 */
public class LocalDateConverter implements Converter {

    @Override
    public LocalDate convert(
            String source) {
        LocalDateTime time = TimeHelper.parseLocalDateTime(source);

        return time == null ? null : time.toLocalDate();
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy