'use strict';

var ArticleFactory = angular.module('articles.factory', [
]).factory('ArticleFactory', [
    'Common',
    function(Common) {

        function Article(data) {
            var self = this;
            if (data) angular.extend(this, data);
            this.PublishedOn = this.PublishedOn ? new Date(this.PublishedOn) : null;
            this.ExpiresOn = this.ExpiresOn ? new Date(this.ExpiresOn) : null;
        }

        var create = function(data) {
            return new Article(data);
        };

        return {
            create: create
        };
    }
]);