Skip to content

Commit 77f781d

Browse files
committed
Improve docs of date filter
1 parent 2d04427 commit 77f781d

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

lib/liquid/standardfilters.rb

+12-3
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,16 @@ def newline_to_br(input)
712712
input.gsub(/\r?\n/, "<br />\n")
713713
end
714714

715-
# Reformat a date using Ruby's core Time#strftime( string ) -> string
715+
# @liquid_public_docs
716+
# @liquid_type filter
717+
# @liquid_category date
718+
# @liquid_summary
719+
# Formats a date according to a specified format string.
720+
# @liquid_description
721+
# This filter formats a date using various format specifiers. If the format string is empty,
722+
# the original input is returned. If the input cannot be converted to a date, the original input is returned.
723+
#
724+
# The following format specifiers can be used:
716725
#
717726
# %a - The abbreviated weekday name (``Sun'')
718727
# %A - The full weekday name (``Sunday'')
@@ -741,8 +750,8 @@ def newline_to_br(input)
741750
# %Y - Year with century
742751
# %Z - Time zone name
743752
# %% - Literal ``%'' character
744-
#
745-
# See also: http://www.ruby-doc.org/core/Time.html#method-i-strftime
753+
# @liquid_syntax date | date: string
754+
# @liquid_return [string]
746755
def date(input, format)
747756
str_format = Utils.to_s(format)
748757
return input if str_format.empty?

0 commit comments

Comments
 (0)