Compare commits

...

2 commits

Author SHA1 Message Date
c15a64eb1d Build 0.17.1 2024-08-23 01:55:11 +02:00
6efdf7d39e Fixed LocalDateTime to ZonedDateTime. 2024-08-23 01:54:27 +02:00
3 changed files with 28 additions and 32 deletions

View file

@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit!
#Thu Oct 14 16:09:34 CEST 2021
build.number=1
#Fri Aug 23 01:55:11 CEST 2024
build.number=2

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2013-2014,2017 Christian Pierre MOMON
* Copyright (C) 2013-2024 Christian Pierre MOMON
*
* This file is part of Devinsy-rss.
*
@ -18,13 +18,11 @@
*/
package fr.devinsy.util.rss;
import java.time.LocalDateTime;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
/**
* The Class RSSElement.
*
* @author Christian Pierre MOMON (christian.momon@devinsy.fr)
*/
public class RSSElement
{
@ -34,29 +32,6 @@ public class RSSElement
private String value;
private String[] attributes;
/**
* Instantiates a new RSS element.
*
* @param name
* the name
* @param value
* the value
*/
public RSSElement(final String name, final LocalDateTime value)
{
setName(name);
if (value == null)
{
this.value = null;
}
else
{
this.value = value.format(DateTimeFormatter.ofPattern(DATE_PATTERN));
}
this.attributes = null;
}
/**
* Instantiates a new RSS element.
*
@ -121,6 +96,28 @@ public class RSSElement
this.attributes = attributes;
}
/**
* Instantiates a new RSS element.
*
* @param name
* the name
* @param value
* the value
*/
public RSSElement(final String name, final ZonedDateTime value)
{
setName(name);
if (value == null)
{
this.value = null;
}
else
{
this.value = value.format(DateTimeFormatter.ofPattern(DATE_PATTERN));
}
this.attributes = null;
}
/**
* Gets the attributes.
*
@ -190,5 +187,4 @@ public class RSSElement
{
this.value = value;
}
}

View file

@ -19,7 +19,7 @@
package fr.devinsy.util.rss.demo;
import java.io.IOException;
import java.time.LocalDateTime;
import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.List;
@ -64,7 +64,7 @@ public class RSSDemo
//
List<RSSElement> elements = new ArrayList<RSSElement>();
LocalDateTime now = LocalDateTime.now();
ZonedDateTime now = ZonedDateTime.now();
elements.add(new RSSElement("pubDate", now));
elements.add(new RSSElement("lastBuildDate", now));
elements.add(new RSSElement("generator", "Generated by Foo"));