File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -715,16 +715,18 @@ defmodule NaiveDateTime do
715715
716716 """
717717 @ spec to_date ( Calendar . naive_datetime ( ) ) :: Date . t ( )
718- def to_date ( % {
719- year: year ,
720- month: month ,
721- day: day ,
722- calendar: calendar ,
723- hour: _ ,
724- minute: _ ,
725- second: _ ,
726- microsecond: _
727- } ) do
718+ def to_date (
719+ % {
720+ year: year ,
721+ month: month ,
722+ day: day ,
723+ calendar: calendar ,
724+ hour: _ ,
725+ minute: _ ,
726+ second: _ ,
727+ microsecond: _
728+ } = _naive_datetime
729+ ) do
728730 % Date { year: year , month: month , day: day , calendar: calendar }
729731 end
730732
@@ -741,16 +743,18 @@ defmodule NaiveDateTime do
741743
742744 """
743745 @ spec to_time ( Calendar . naive_datetime ( ) ) :: Time . t ( )
744- def to_time ( % {
745- year: _ ,
746- month: _ ,
747- day: _ ,
748- calendar: calendar ,
749- hour: hour ,
750- minute: minute ,
751- second: second ,
752- microsecond: microsecond
753- } ) do
746+ def to_time (
747+ % {
748+ year: _ ,
749+ month: _ ,
750+ day: _ ,
751+ calendar: calendar ,
752+ hour: hour ,
753+ minute: minute ,
754+ second: second ,
755+ microsecond: microsecond
756+ } = _naive_datetime
757+ ) do
754758 % Time {
755759 hour: hour ,
756760 minute: minute ,
@@ -1146,16 +1150,18 @@ defmodule NaiveDateTime do
11461150 """
11471151 @ doc since: "1.11.0"
11481152 @ spec to_gregorian_seconds ( Calendar . naive_datetime ( ) ) :: { integer ( ) , non_neg_integer ( ) }
1149- def to_gregorian_seconds ( % {
1150- calendar: calendar ,
1151- year: year ,
1152- month: month ,
1153- day: day ,
1154- hour: hour ,
1155- minute: minute ,
1156- second: second ,
1157- microsecond: { microsecond , precision }
1158- } ) do
1153+ def to_gregorian_seconds (
1154+ % {
1155+ calendar: calendar ,
1156+ year: year ,
1157+ month: month ,
1158+ day: day ,
1159+ hour: hour ,
1160+ minute: minute ,
1161+ second: second ,
1162+ microsecond: { microsecond , precision }
1163+ } = _naive_datetime
1164+ ) do
11591165 { days , day_fraction } =
11601166 calendar . naive_datetime_to_iso_days (
11611167 year ,
You can’t perform that action at this time.
0 commit comments