Skip to content

Commit 4d8e8fa

Browse files
committed
minor, reactivate dgrepping for %c (count within month)
1 parent 2950cdb commit 4d8e8fa

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

lib/date-core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,8 @@ dt_get_md(struct dt_d_s that)
251251
}
252252
}
253253

254-
/* too exotic to be public */
255-
static int
254+
/* too exotic to be public, nope bug #81 needs it */
255+
int
256256
dt_get_wcnt_mon(struct dt_d_s that)
257257
{
258258
if (LIKELY(that.typ == DT_YMCW)) {

lib/date-core.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,10 @@ extern unsigned int dt_get_yday(struct dt_d_s d);
462462
* Return N where N is the week within the year that THIS is in. */
463463
extern int dt_get_wcnt_year(struct dt_d_s this, unsigned int wkcnt_convention);
464464

465+
/**
466+
* Return N where N is the week within the month that THIS is in. */
467+
extern int dt_get_wcnt_mon(struct dt_d_s this);
468+
465469
/* converters */
466470
extern dt_daisy_t dt_conv_to_daisy(struct dt_d_s);
467471

src/dexpr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ dexkv_matches_p(const_dexkv_t dkv, struct dt_dt_s d)
560560
break;
561561
case DT_SPFL_N_WCNT_MON:
562562
/* exotic function, needs extern'ing */
563-
cmp = /*dt_get_count(d)*/0;
563+
cmp = dt_get_wcnt_mon(d.d);
564564
break;
565565
case DT_SPFL_N_DCNT_YEAR:
566566
cmp = dt_get_yday(d.d);

0 commit comments

Comments
 (0)