Skip to content

Commit

Permalink
chore(Date) deprecate the Date module/class
Browse files Browse the repository at this point in the history
closes #285
  • Loading branch information
Tieske committed Jan 7, 2021
1 parent 94693b1 commit 154f542
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ see [CONTRIBUTING.md](CONTRIBUTING.md#release-instructions-for-a-new-version) fo
[#360](https://github.com/lunarmodules/Penlight/pull/360)
- deprecate: `permute.table`, renamed to `permute.order_table` (removal later)
[#360](https://github.com/lunarmodules/Penlight/pull/360)
- deprecate: `Date` module (removal later)
[#367](https://github.com/lunarmodules/Penlight/pull/367)
- feat: `permute.list_iter` to iterate over different sets of values
[#360](https://github.com/lunarmodules/Penlight/pull/360)
- feat: `permute.list_table` generate table with different sets of values
Expand Down
2 changes: 2 additions & 0 deletions docs_topics/05-dates.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

<a id="date"></a>

NOTE: the Date module is deprecated

### Creating and Displaying Dates

The `Date` class provides a simplified way to work with [date and
Expand Down
12 changes: 12 additions & 0 deletions lua/pl/Date.lua
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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()

Expand Down

0 comments on commit 154f542

Please sign in to comment.