Skip to content

Conversion support for java.time.YearMonth (as well as MonthDay) [SPR-13518] #18095

Closed
@spring-projects-issues

Description

@spring-projects-issues

Kazuki Shimizu opened SPR-13518 and commented

I hope to support the java.time.YearMonth class in type conversion service.

For example:

@RequestMapping("/timecards")
@Controller
public class TimecardController {
        @Autowired
        TimecardService timecardService;

	@RequestMapping(path = "{targetMonth}", method = RequestMethod.GET)
	public String viewDetail(@DateTimeFormat(pattern = "yyyyMM") @PathVariable YearMonth targetMonth, Model model) {
                Timecard timecard = timecardService.getTimecard(targetMonth);
		model.addAttribute(timecard);
		return "timecard/detail";
	}
}

How do think ?


Affects: 4.2.1

Issue Links:

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions