From 306bd2fda7bbf8cc8ca9fe9f69fecb104e79c932 Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Thu, 7 Jan 2021 10:09:44 +0100 Subject: [PATCH] chore(Date) deprecate the Date module/class closes #285 --- docs_topics/05-dates.md | 2 ++ lua/pl/Date.lua | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/docs_topics/05-dates.md b/docs_topics/05-dates.md index c2431cfd..32c42f77 100644 --- a/docs_topics/05-dates.md +++ b/docs_topics/05-dates.md @@ -2,6 +2,8 @@ +NOTE: the Date module is deprecated + ### Creating and Displaying Dates The `Date` class provides a simplified way to work with [date and diff --git a/lua/pl/Date.lua b/lua/pl/Date.lua index 9c878d67..8382cc9e 100644 --- a/lua/pl/Date.lua +++ b/lua/pl/Date.lua @@ -1,6 +1,9 @@ --- Date and Date Format classes. -- See @{05-dates.md|the Guide}. -- +-- NOTE: the date module is deprecated! see +-- https://github.com/lunarmodules/Penlight/issues/285 +-- -- Dependencies: `pl.class`, `pl.stringx`, `pl.utils` -- @classmod pl.Date -- @pragma nostrip @@ -11,6 +14,15 @@ local stringx = require 'pl.stringx' local utils = require 'pl.utils' local assert_arg,assert_string = utils.assert_arg,utils.assert_string + +utils.deprecation_warning { + source = "Penlight " .. utils._VERSION, + message = "the 'Date' module is deprecated, see https://github.com/lunarmodules/Penlight/issues/285", + version_removed = "2.0.0", + version_deprecated = "1.9.2", +} + + local Date = class() Date.Format = class()