Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dates.rb « support « qa « qa - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3d1f146730b641f9af64155c84ab823c8425424d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# frozen_string_literal: true

module QA
  module Support
    module Dates
      def current_date_yyyy_mm_dd
        current_date.strftime("%Y/%m/%d")
      end

      def next_month_yyyy_mm_dd
        current_date.next_month.strftime("%Y/%m/%d")
      end

      def format_date(date)
        new_date = DateTime.strptime(date, "%Y/%m/%d")
        new_date.strftime("%b %-d, %Y")
      end

      private

      def current_date
        DateTime.now
      end
    end
  end
end