package com.dev.swms.server.action.formatter;

import java.util.Date;
import java.util.List;

import com.dev.energy.server.format.Formatter;
import com.dev.swms.server.utils.DateUtils;

public class ContractDayFormatter  implements Formatter{
	
	
	public String format(String property, Object storageDate, List origenData,
			String referenceModel, String locale) {
		Integer day=0;
		if(storageDate instanceof Date) {
			day= DateUtils.getBetweenDays(new Date(),(Date) storageDate);
		}else{
			return "-";
		}
		if(day<30){
			return "<div style='background-color:red' >" + day + "</div>";
		}else{
			return day + "";
		}
	}
}
